unknown user name or bad password for connection

Posted on 2006-05-18
Last Modified: 2007-11-27
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:
Question by:mathieu_cupryk
    LVL 6

    Expert Comment

    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


    Author Comment

    I cannot add it to the code?

    LVL 6

    Expert Comment

    it is supposed to be added to the web.config

    u can add it above the line


    LVL 6

    Accepted Solution

    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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now