Terrance C

Terrance C

  • NA
  • 27
  • 1.3k

Passing is password with quotes

May 13 2013 12:12 PM
Good Morning everyone. I was wondering if someone can point me in the right direction on an issue that I'm having. Basically, I'm trying to copy a file over from one server to another in C#. The target server drive is not on the domain but I can access it with a user account and when browsing to it. I'm using the windows LogOn functionality to pass the username, password, domain, and logontype and etc. Unfortunately, my code is returning an error of bad user name or password. I'm thinking that the problem is that the password has quotes in it (e.g. gh"/m"pp) C# is parsing out the quotes in code when printing it on the console window; but I'm beginning to wondering if the slashes within the parse is being passed to the LOGON function; so when dubugging the password looks like (e.g. gh"\/m\"pp) 

Has anyone else experience this issue? I tried using StringBuilder and @ sign but in the dubugger C# is still formatting the data as above.

Answers (3)