locked
Logon failure: unknown user name or bad password RRS feed

  • Question

  • Hi all,

    when i try with System.IO.FileStream to write file via on network as some code:

    filepath = "\\<serverIP>\<sharefolder>\<filename>"

    System.IO.BinaryWriter bw = new System.IO.BinaryWriter(new System.IO.FileStream(filepath, System.IO.FileMode.Create)))

    but it return error: Logon failure: unknown user name or bad password.

    please any idea.

    thanks in advance.

    trandtun
    Monday, July 6, 2009 9:56 AM

Answers

  • Hi trandtun,

     

    Based on my understanding, the root cause is that you did not append the user name and password to the UNC path. Please change the file path to this format:

              \\<serverIP>\<sharefolder>\<filename>@<userName>,<password>

    For example:

              \\196.23.1.23\New Folder\New Text Document.txt@administrator,123456

     

    Let me know if this helps.
    Aland Li


    Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
    • Marked as answer by Aland Li Tuesday, July 14, 2009 12:28 PM
    Wednesday, July 8, 2009 7:40 AM

All replies

  • How is this related to setup and deployment projects? Is this code in a custom action maybe?


    Phil Wilson
    Monday, July 6, 2009 10:27 PM
  • Hi trandtun,

     

    Based on my understanding, the root cause is that you did not append the user name and password to the UNC path. Please change the file path to this format:

              \\<serverIP>\<sharefolder>\<filename>@<userName>,<password>

    For example:

              \\196.23.1.23\New Folder\New Text Document.txt@administrator,123456

     

    Let me know if this helps.
    Aland Li


    Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
    • Marked as answer by Aland Li Tuesday, July 14, 2009 12:28 PM
    Wednesday, July 8, 2009 7:40 AM