401 errro in HttpWebResponse loWebResponse = (HttpWebResponse)loHttp.GetResponse(); RRS feed

  • Question

  • User735199033 posted






    Hi all,

     could any please slove this problem, i am getting error 401 un authozied, but i am giving correct user name and password of the network user name and password of my system.


     i am getting error in  this line


    loWebResponse = (HttpWebResponse)loHttp.GetResponse();

    below is code i am using

    strExport =System.Configuration.

    ConfigurationSettings.AppSettings["ReportURL"].ToString() + ViewState["ExportLink"





    HttpWebRequest loHttp = (HttpWebRequest)WebRequest



    loHttp.Credentials =

    new NetworkCredential

    (strLoginID, strPassword, strDomain);

    loHttp.Timeout = 100000;

    loHttp.UserAgent =

    "Code Sample Web Client"



    HttpWebResponse loWebResponse = (HttpWebResponse


    Monday, March 7, 2011 11:06 PM


  • User1113735518 posted

    Please use try catch around your code and find out what error is throwing...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 8, 2011 2:09 AM