Hawk 207 Hi everyone, I don't understand this error and I am looking for 1 hour straight to it. I decided to post this on C.to, please help me out! Maybe @cups or @kekd know this but uhmm.. Exception: System.ArgumentException HResult=0x80070057 Message=Illegal characters in path. Source=mscorlib StackTrace: at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional) at System.IO.Path.GetFileName(String path) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) at Leaf.xNet.FileContent..ctor(String pathToContent, Int32 bufferSize) at Leaf.xNet.HttpRequest.Post(String address, String path) at VoorTestn.Program.Main(String[] args) in C:\Users\REMOVED\Desktop\alles\repos\VoorTestn\VoorTestn\Program.cs:line 50 Line of code: string str = string.Concat(new string[] { "{\"email\":\"", naam, "\",\"password\":\"", wachtwoord, "\"}" }); Thanks! PS: naam and wachtwoord are strings. those are normal. 1 Quote Share this post Link to post Share on other sites
300Thousand 102 Your code will call System.IO.Path.CheckInvalidPathChars, which in turn checks for the the following: double quote (") left angle bracket (<) right angle bracket (>) veritical bar (|) and for control characters less than 32 decimal (space). make sure that these are not in your path Quote Share this post Link to post Share on other sites
Hawk 207 Your code will call System.IO.Path.CheckInvalidPathChars, which in turn checks for the the following: double quote (") left angle bracket (<) right angle bracket (>) veritical bar (|) and for control characters less than 32 decimal (space). make sure that these are not in your path I see some, how can I fix the double quotes ones? I have something like this: email:/"' so e m a i l : /" " Quote Share this post Link to post Share on other sites
300Thousand 102 sir the path is the problem not your code try this path C:\\Users\REMOVED\Desktop\alles\repos\VoorTestn\VoorTestn\Program.cs:line 50 answers can come late since im at my university and learning Quote Share this post Link to post Share on other sites
Cups 97 I have the solution. You are making a call to xNet trying to post form data to an url. So what you did is xNet.HttpRequest.Post("www.test.com", postData); Unfortunately, xNet thinks that you are trying to send the file located at the path [postData] (Look at the stack trace, the arguments are : Leaf.xNet.HttpRequest.Post(String address, String path)). Therefore, to fix this you need to change the HttpRequest.Post("www.test.com", postData) to HttpRequest.Post("www.test.com", postData, "application/x-url-form-encoded"); Post Data is "str" in your code, it looks like JSON so you may need to change "application/x-url-form-encoded" to "application/json" (string str = string.Concat(new string[] { "{\"email\":\"", naam, "\",\"password\":\"", wachtwoord, "\"}" }); ) Quote Share this post Link to post Share on other sites