質問編集履歴
2
コード追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -40,9 +40,9 @@
|
|
40
40
|
|
41
41
|
|
42
42
|
|
43
|
-
//
|
43
|
+
//endキーを押しても表示なし
|
44
44
|
|
45
|
-
if (Keyboard.IsKeyDown(Key.
|
45
|
+
if (Keyboard.IsKeyDown(Key.End) == true)
|
46
46
|
|
47
47
|
{
|
48
48
|
|
1
コード追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,6 +14,72 @@
|
|
14
14
|
|
15
15
|
```C#
|
16
16
|
|
17
|
+
string[] GetFilesMostDeep(string stRootPath, string stPattern)
|
18
|
+
|
19
|
+
{
|
20
|
+
|
21
|
+
System.Collections.Specialized.StringCollection hStringCollection = (
|
22
|
+
|
23
|
+
new System.Collections.Specialized.StringCollection()
|
24
|
+
|
25
|
+
);
|
17
26
|
|
18
27
|
|
28
|
+
|
29
|
+
// このディレクトリ内のすべてのファイルを検索する
|
30
|
+
|
31
|
+
foreach (string stFilePath in System.IO.Directory.GetFiles(stRootPath, stPattern))
|
32
|
+
|
33
|
+
{
|
34
|
+
|
35
|
+
hStringCollection.Add(stFilePath);
|
36
|
+
|
37
|
+
}
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
//右キーを押しても表示なし
|
44
|
+
|
45
|
+
if (Keyboard.IsKeyDown(Key.Right) == true)
|
46
|
+
|
47
|
+
{
|
48
|
+
|
49
|
+
MessageBox.Show("");
|
50
|
+
|
51
|
+
}
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
// このディレクトリ内のすべてのサブディレクトリを検索する (再帰)
|
56
|
+
|
57
|
+
foreach (string stDirPath in System.IO.Directory.GetDirectories(stRootPath))
|
58
|
+
|
59
|
+
{
|
60
|
+
|
61
|
+
string[] stFilePathes = GetFilesMostDeep(stDirPath, stPattern);
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
//処理
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
}
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
// StringCollection を 1 次元の String 配列にして返す
|
74
|
+
|
75
|
+
string[] stReturns = new string[hStringCollection.Count];
|
76
|
+
|
77
|
+
hStringCollection.CopyTo(stReturns, 0);
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
return stReturns;
|
82
|
+
|
83
|
+
}
|
84
|
+
|
19
85
|
```
|