# 取得ファイルを数える方法

**URL:** <https://forum.uipath.com/t/topic/343728>\
**Category:** フォーラム\
**Created:** [September 8, 2021, 11:15pm UTC](https://forum.uipath.com/t/topic/343728 "2021-09-08T23:15:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukatopdesrlat](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lukatopdesrlat/32/181327_2.png) [@lukatopdesrlat](https://forum.uipath.com/u/lukatopdesrlat)\
**Post date:** [September 8, 2021, 11:15pm UTC](https://forum.uipath.com/t/topic/343728/1 "2021-09-08T23:15:23Z")

</div>

こんにちは、いつも助けていただいています。

Directory.GetFiles(FolderPath)で取得したファイルの数をカウントしたいのですが、その方法を教えていただきたいです。  
その際Int型にしたいのですがその場合はまた代入が必要になってくるのでしょうか？それともカウントした時点でInt型になっているのでしょうか？

よろしくお願いします。

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [September 8, 2021, 11:25pm UTC](https://forum.uipath.com/t/topic/343728/2 "2021-09-08T23:25:53Z")

</div>

こんにちは

```
arrayString = Directory.GetFiles(FolderPath)

```

とすると

```
intCount = arrayString.Length

```

となります。  
arrayStringはString配列、intCountはInt32型です。

---

<div class="post-metadata">

**Author:** ![lukatopdesrlat](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lukatopdesrlat/32/181327_2.png) [@lukatopdesrlat](https://forum.uipath.com/u/lukatopdesrlat)\
**Post date:** [September 8, 2021, 11:45pm UTC](https://forum.uipath.com/t/topic/343728/3 "2021-09-08T23:45:15Z")

</div>

できました！  
いつもありがとうございます。おかげで解決しました！

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [September 11, 2021, 11:45pm UTC](https://forum.uipath.com/t/topic/343728/4 "2021-09-11T23:45:40Z")

</div>

Closed on September 11, 2021, 11:45pm UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
