I am writing a C#
application to get some information from URL.
The Url's are of Web applications hosted in IIS
in our local intranet environment.
The web applications are developed using ASP.NET (C#).
In IIS
these are configured as either Forms or Windows authentication.
Is there a way to identify what type of authentication is the corresponding web application urls ?
This is what i got so far !
using System;
using System.IO;
using System.Net;
public class Program
{
public static void Main()
{
var url = "http://www.contoso.com/default.html";
WebRequest request = WebRequest.Create(url);
HttpWebResponse response = (HttpWebResponse)request.GetResponse ();
//he i need to know what type of authentication the url
Console.WriteLine (response.StatusDescription);
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader (dataStream);
string responseFromServer = reader.ReadToEnd();
reader.Close ();
dataStream.Close ();
response.Close ();
}
}