• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 347
  • Last Modified:

unknown user name or bad password for connection

Logon failure: unknown user name or bad password.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.IOException: Logon failure: unknown user name or bad password.

Source Error:

Line 32:         Label1.Text = dir.ToString
Line 33:         'Holds files returned from dir object
Line 34:         Dim files As IO.FileInfo() = dir.GetFiles("*.exe")
Line 35:
Line 36:         Dim fileName As IO.FileInfo
 Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        Dim dir As New IO.DirectoryInfo("\\loncommon\ddgmemd")

        Label1.Text = dir.ToString
        'Holds files returned from dir object
        Dim files As IO.FileInfo() = dir.GetFiles("*.exe")

        Dim fileName As IO.FileInfo
        For Each fileName In files

    End Sub
Somehow I have to put the username and password.

Source File: C:\Inetpub\wwwroot\LegacyDB\ReportApp.aspx.vb    Line: 34

Stack Trace:
  • 3
1 Solution
have i tried this
<identity impersonate="true"/>

just add the username and password to it

<identity impersonate="true" userName="Username" password="pwd"/>

mention the ADministrator username and password in that for trial

mathieu_cuprykAuthor Commented:
I cannot add it to the code?

it is supposed to be added to the web.config

u can add it above the line


and where i mention the UserName and password it is case sensitive and u have to add the user name and password of the privileged users like the person who has the network acess rights.

<identity impersonate="true" userName="username" password="pwd"/>

this is exact entry for the identity tag

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now