`ipAddress` string.Split() could use a comma :)
mm98 opened this issue · 2 comments
I tried to use this tool earlier today. For some strange reason, on my Win11 the ipAddress
entry was submitted with commas and not with periods, which made the app crash (separator must exist in ipAddress
). It did show period in the UI. I had to download the source to add the following to make it work.
Added comma
as a second separator on the string split.
int[] ipParts = ipAddress.Split(new String[] { ".", "," }, StringSplitOptions.RemoveEmptyEntries)
.Select(s => int.Parse(s)).ToArray();
ClaimIt/Windows/ClaimIt/Form1.cs
Line 278 in e979499
The most likely problem is that the app uses culture specific number separators when parsing the ip address. Instead it should always use CultureInfo.InvariantCulture
to parse it.
This is the exception:
System.FormatException: Die Eingabezeichenfolge hat das falsche Format.
bei System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
bei System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
bei ClaimIt.Form1.<>c.<_IsPrivate>b__40_0(String s)
bei System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
bei System.Linq.Buffer`1..ctor(IEnumerable`1 source)
bei System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
bei ClaimIt.Form1._IsPrivate(String ipAddress)
bei ClaimIt.Form1.BtnClaimIt_Click(Object sender, EventArgs e)
Windows version has been replaced with this one
https://github.com/ukdtom/ClaimPMS4Win/releases/latest