mrpega Regular Member Joined Sep 19, 2008 Messages 393 Reaction score 105 Nov 1, 2008 #1 Does for example declaring: Uri u = new Uri("http://www.google.com"); actually means that the application has accessed the page like a real human has enter the url into browser?
Does for example declaring: Uri u = new Uri("http://www.google.com"); actually means that the application has accessed the page like a real human has enter the url into browser?
doczoidberg Junior Member Joined Feb 10, 2008 Messages 173 Reaction score 55 Nov 1, 2008 #2 Uri is only a Data-Class. How do you access the web? What do you want to do?
mrpega Regular Member Joined Sep 19, 2008 Messages 393 Reaction score 105 Nov 1, 2008 Thread Starter Thread Starter #3 sorry i meant if i put : WebRequest http = HttpWebRequest.Create(url); HttpWebResponse response = (HttpWebResponse)http.GetResponse(); Stream stream = response.GetResponseStream(); after the uri declaration..thanks for the help!!
sorry i meant if i put : WebRequest http = HttpWebRequest.Create(url); HttpWebResponse response = (HttpWebResponse)http.GetResponse(); Stream stream = response.GetResponseStream(); after the uri declaration..thanks for the help!!
doczoidberg Junior Member Joined Feb 10, 2008 Messages 173 Reaction score 55 Nov 1, 2008 #4 hmm i don't know. I access websites via the webclient-class. This "simulates" the Browser...
J joejoe1234 Newbie Joined Jan 8, 2008 Messages 32 Reaction score 5 Nov 15, 2008 #5 using (WebClient wc = new WebClient() ) { wc.Proxy=null; wc.Headers.Add ("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705"); //if authenticated add a credential set string userName="[email protected]"; string password = "mypass"; wc.Credentials = new NetworkCredential(userName, password); wc.DownloadData("http://yoursite.com/"); }
using (WebClient wc = new WebClient() ) { wc.Proxy=null; wc.Headers.Add ("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705"); //if authenticated add a credential set string userName="[email protected]"; string password = "mypass"; wc.Credentials = new NetworkCredential(userName, password); wc.DownloadData("http://yoursite.com/"); }