Skip to main content

Hans Muster's Library tagged no_tag   View Popular

15 May 08

SourceForge.net: Files

  • Personal wiki that lives in one self-modifying XHTML containing software, interface and data. Very useful for creating small websites and mantaining notes or todo-lists; completely javascript-programmable, supports images and files embedding.
12 Jun 07

Re: Automating login to website with IIS basic authentication - MSDN Forums




  • Hi Rick,


    Here is the link I used to learn about doing this:

    http://www.port80software.com/support/articles/authenticationiniis



    I can supply you with the code I used to send the user and pass to a site with IIS basic authentication setup but it might be a little confusing since it's modified for my particular application. Also some variable declarations are missing since they are in other parts of the code but this should point you in the right direction... I used the webbrowser object(AxWebBrowser1) to do the actual redirect.

    byte[] data;
    object objheader;
    ASCIIEncoding encoding= new ASCIIEncoding(); 
    data = Encoding.UTF8.GetBytes("");
    object objdata = data;
    object objnull = "";
    string userPass = "myPassword";

    //then convert to bytes
    byte[] AuthData=System.Text.UnicodeEncoding.UTF8.GetBytes(userPass);
    Base64Encoder myEncoder=new Base64Encoder(AuthData);
    StringBuilder sb=new StringBuilder();
    //Dos would not transfer \r properly from .bat file so we had to recreate it in c#
    sb.Append(this.webParams.Substring(0,this.webParams.LastIndexOf("Authorization:")) + "\r");
    //reapply the following string which was taken out during parsing and
    //addition of \r for carriage return which is neccessary for the proper http header formation
    sb.Append("Authorization: Basic ");
    //add the new base64 encoded password
    sb.Append(myEncoder.GetEncoded());
    //apply string to object 
    objheader = "Content-Type:application/x-www-form-urlencoded\rUser-Agent: MSIE\r" + sb.ToString();

    /for debug
    //MessageBox.Show("Content-Type:application/x-www-form-urlencoded\rUser-Agent: MSIE\r" + sb.ToString());

09 Nov 06

Error: Unable to open shim database - MSDN Forums

  • HKLM\Software\Microsoft\.NETFramework\Policy\AppPatch
1 - 10 of 10
Showing 20 items per page

Diigo is about better ways to research, share and collaborate on information. Learn more »

Join Diigo