回答編集履歴

4

後半部回答の欠落の補てん

2015/05/18 08:53

投稿

KeiOkuma
KeiOkuma

スコア7

test CHANGED
@@ -1,6 +1,4 @@
1
- ReadAllLines()でテキストから配列を取得後、整数の配列に変換してリストに入れていけば?
1
+ まず、ReadAllLines()でテキストから配列を取得後、整数の配列に変換してリストに入れる。
2
-
3
-
4
2
 
5
3
  ```lang-<ここに言語を入力>
6
4
 
@@ -33,3 +31,21 @@
33
31
  }
34
32
 
35
33
  ```
34
+
35
+ 次にリスト内の整数配列をPointに変換して、フォームの位置に代入しては?
36
+
37
+ ```lang-<ここに言語を入力>
38
+
39
+ Form form1 = new Form();
40
+
41
+ form1.Location = new Point(locationList[0][0] , locationList[0][1]);
42
+
43
+ Form form2 = new Form();
44
+
45
+ form2.Location = new Point(locationList[1][0] , locationList[1][1]);
46
+
47
+ ・・・
48
+
49
+ ```
50
+
51
+

3

ファイル名の修正と空行の削除

2015/05/18 08:53

投稿

KeiOkuma
KeiOkuma

スコア7

test CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- string[] lines1 = File.ReadAllLines("shiftjis.txt",
11
+ string[] lines1 = File.ReadAllLines("Sample.txt",
12
12
 
13
13
  System.Text.Encoding.GetEncoding("Shift_JIS"));
14
14
 
@@ -19,8 +19,6 @@
19
19
  foreach(var item in lines1)
20
20
 
21
21
  {
22
-
23
-
24
22
 
25
23
  string[] strTmp = item.Split(',');
26
24
 

2

ロジックの修正(Int変換の誤り)

2015/05/18 08:39

投稿

KeiOkuma
KeiOkuma

スコア7

test CHANGED
@@ -20,7 +20,13 @@
20
20
 
21
21
  {
22
22
 
23
+
24
+
23
- tmp = Convert.ToInt32(item.Split(','));
25
+ string[] strTmp = item.Split(',');
26
+
27
+ tmp[0] = Convert.ToInt32(strTmp[0]);
28
+
29
+ tmp[1] = Convert.ToInt32(strTmp[1]);
24
30
 
25
31
  locationList.Add(tmp);
26
32
 

1

コード内の誤字の修正(String → item)

2015/05/18 08:37

投稿

KeiOkuma
KeiOkuma

スコア7

test CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  {
22
22
 
23
- tmp = Convert.ToInt32(String.Split(','));
23
+ tmp = Convert.ToInt32(item.Split(','));
24
24
 
25
25
  locationList.Add(tmp);
26
26