質問編集履歴
3
スクリーンショット追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -19,4 +19,5 @@
|
|
19
19
|
|
20
20
|
###補足情報(言語/FW/ツール等のバージョンなど)
|
21
21
|
より詳細な情報
|
22
|
-
](3cd478d1c0cab2b6cda3f5a68d46645f.png)
|
22
|
+
](3cd478d1c0cab2b6cda3f5a68d46645f.png)
|
23
|
+

|
2
Markdown記法に従いました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,12 +1,22 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
という判定条件の中で、
|
4
|
-
int.Parse(input_ipadress[2])>=int.Parse(range_ipadress_2[0]) && int.Parse(input_ipadress[2])<=int.Parse(range_ipadress_2[1]) && int.Parse(ipadress[3])>=int.Parse(range_ipadress_3[0]) && int.Parse(ipadress[3])<=int.Parse(range_ipadress_3[1])
|
5
|
-
の部分で、input_ipadress[2]が整数に変換できません。(Visual studio でデバッグ済みです)
|
6
|
-
自分でもググってみて、
|
7
|
-
https://support.microsoft.com/ja-jp/help/942460/system-formatexception-occurs-when-attempting-to-convert-a-numeric-str
|
8
|
-
の記事を見つけ試してみましたが、解決しません。
|
9
|
-
どなたかご教示ください。
|
10
|
-
以下がvisual studio のスクリーンショットです。
|
1
|
+
###前提・実現したいこと
|
2
|
+
C#でSystem.FormatExceptionを解決したい
|
11
3
|
|
12
|
-
|
4
|
+
###発生している問題・エラーメッセージ
|
5
|
+
|
6
|
+
```
|
7
|
+
Unhandled Exception:
|
8
|
+
System.FormatException: Input string was not in a correct format.
|
9
|
+
at System.Number.StringToNumber (System.String str, NumberStyles options, System.NumberBuffer& number, System.Globalization.NumberFormatInfo info, Boolean parseDecimal)
|
10
|
+
```
|
11
|
+
|
12
|
+
###該当のソースコード
|
13
|
+
```C#
|
14
|
+
if(ipadress[0]==input_ipadress[0] && ipadress[1]==input_ipadress[1] && int.Parse(input_ipadress[2])>=int.Parse(range_ipadress_2[0]) && int.Parse(input_ipadress[2])<=int.Parse(range_ipadress_2[1]) && int.Parse(ipadress[3])>=0 && int.Parse(ipadress[3])<=255)
|
15
|
+
```
|
16
|
+
|
17
|
+
###試したこと
|
18
|
+
Visual Studio でデバッグしint.Parse(input_ipadress[2])>=int.Parse(range_ipadress_2[0]) の真偽値に何も入らないです。以下にスクリーンショットを載せます。
|
19
|
+
|
20
|
+
###補足情報(言語/FW/ツール等のバージョンなど)
|
21
|
+
より詳細な情報
|
22
|
+
](3cd478d1c0cab2b6cda3f5a68d46645f.png)
|
1
visual studio のスクリーンショットを追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -6,4 +6,7 @@
|
|
6
6
|
自分でもググってみて、
|
7
7
|
https://support.microsoft.com/ja-jp/help/942460/system-formatexception-occurs-when-attempting-to-convert-a-numeric-str
|
8
8
|
の記事を見つけ試してみましたが、解決しません。
|
9
|
-
どなたかご教示ください。
|
9
|
+
どなたかご教示ください。
|
10
|
+
以下がvisual studio のスクリーンショットです。
|
11
|
+
|
12
|
+

|