0

I have written FTP server in C# which is working quite fine with client on one machine, but when i try to send file to server from other PC,

Exception occurs, Input string was not in correct format

double FileSize = double.Parse(System.Text.Encoding.ASCII.GetString(downBuffer, 0, bytesSize));
3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by abcdabid
0

That usually means that the parsing failed. Make sure that what you are trying to parse can actually be parsed into a double.

Console.WriteLine(System.Text.Encoding.ASCII.GetString(downBuffer, 0, bytesSize));
0

I have written FTP server in C# which is working quite fine with client on one machine, but when i try to send file to server from other PC,

Exception occurs, Input string was not in correct format

double FileSize = double.Parse(System.Text.Encoding.ASCII.GetString(downBuffer, 0, bytesSize));

Parse failed - suggested by @sergb. Can you maybe provide some more information about what it is you are trying to do? I think you are trying to get the length of file. Isn't it?

To parse string to double you can use TryParse static method.

double v;
double.TryParse(System.Text.Encoding.ASCII.GetString(downBuffer, 0, bytesSize),out v);
0

Now my self-written FTP server is working fine with my self written FTP client, but when i try to connect my server through CUTEFTP or COREFTP clients then i am unable to receive files. it gives some exceptions like "illegal character in path" "C:\path not found"
:(

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.