This code shows how you can load a web page using c#
make sure to include
using System.Net;
string url = "http://www.bitlinkit.com";
HttpWebRequest wRequest = (HttpWebRequest)WebRequest.Create(url);
//Optional Lines below - for redirects
wRequest.AllowAutoRedirect = false;
wRequest.MaximumAutomaticRedirections = 1;
//Optional lines below - for cookies
static CookieContainer MyCookieContainer = new CookieContainer(); // global static - so that it can remember all cookies
wRequest.CookieContainer = MyCookieContainer;
WebResponse wResponse = wRequest.GetResponse();
System.IO.Stream rStream = wResponse.GetResponseStream();
System.IO.StreamReader sReader = new System.IO.StreamReader(rStream);
//again optional - for cookies
MyCookieContainer = wRequest.CookieContainer;
string TextFromPage = sReader.ReadToEnd();
//----------------------------------------------------------------------------------------
//below lines are optional: use the following to look at cookies as they come in:
foreach (Cookie cook in wResponse.Cookies)
{
Console.WriteLine("Cookie:");
Console.WriteLine("{0} = {1}", cook.Name, cook.Value);
Console.WriteLine("Domain: {0}", cook.Domain);
Console.WriteLine("Path: {0}", cook.Path);
Console.WriteLine("Port: {0}", cook.Port);
Console.WriteLine("Secure: {0}", cook.Secure);
Console.WriteLine("When issued: {0}", cook.TimeStamp);
Console.WriteLine("Expires: {0} (expired? {1})",
cook.Expires, cook.Expired);
Console.WriteLine("Don't save: {0}", cook.Discard);
Console.WriteLine("Comment: {0}", cook.Comment);
Console.WriteLine("Uri for comments: {0}", cook.CommentUri);
Console.WriteLine("Version: RFC {0}", cook.Version == 1 ? "2109" : "2965");
// Show the string representation of the cookie.
Console.WriteLine("String: {0}", cook.ToString());
}
分享到:
相关推荐
Readers will learn how to design loading sequences that ensure users stay fully engaged instead of tuning out, how to leverage simple physics principles to make apps respond naturally to users’ input...
使用钩子在React中发出axios请求。 安装 使用npm: $ npm install use-axios-client ... { loading && < div> Loading... < / div > } { error && < div> { error . message } < / div > } { da
C# winfrom读取数据时候出现的等待loading界面,使用委托事件,在应用程序进行数据加载的时候出现loading等待界面,提高用户体验度,是一个比较容易读懂的案例
实现真正的网页下载提示条web----loading 实现真正的网页下载提示条web----loading
Be accessible to disabled users who use screenreaders to browse the WebBy the end of the book, you’ll be equipped with enough knowledge to set out on your first projects as a professional web ...
Use of a simulation model to examine effects of nutrient loading
powermock-classloading-xstream-1.4.7powermock-classloading-xstream-1.4.7powermock-classloading-xstream-1.4.7powermock-classloading-xstream-1.4.7powermock-classloading-xstream-1.4.7powermock-class...
winform的一个简单易用异步加载等待效果,调用方式: this.AsyncWaitDo(delegate{ //异步等待操作}, delegate{//回调操作}); this是要进行异步等待的窗体
If you use a LANtastic network, disable it before running Setup. 2.15 Western Digital SCSI Hard-Disk Controllers ----------------------------------------------- If you are using a Western Digital WD ...
Be accessible to disabled users who use screenreaders to browse the WebBy the end of the book, you’ll be equipped with enough knowledge to set out on your first projects as a professional web ...
5.1.4 Loading images using OME Bio-Formats library. 7 5.1.5 Basic image processing using ImageJ/Fiji 9 5.2 Overview of algorithms in WIPP. 11 5.3 Image correction algorithms. 13 5.3.1 Dark current...
自定义控件,实现在winform窗口中点击查询等待时的页面加载遮罩效果,背景半透明,结果返回前被遮罩的控件不可用。 有问题可留言http://blog.csdn.net/quan278905570
C#基于自定义消息做一个Loading界面. 欢迎下载,有问题请联系~~ 注意,代码中Loading窗的位置自己控制,因为是透明背景,位置不对会难发现
用钩React 该项目仍处于测试阶段,...const [ list , pageInfo , loading , setList , setPageInfo , setLoading ] = usePage ( ) const [ attribute ] = useResize ( ) const [ refresh , params , setRefresh , setPa
A kind of Optimization Method of Loading Documents in OpenOffice.org 论文
useUnmountRef React钩子处理卸载参考。 目录 细节 用法 安装 yarn add @technote-space/use-unmount-ref 或者 npm i @technote-space/use-unmount-ref ... const [ isLoading , setIsLoading ] = useState ( fals
In recent decades, structural health monitoring systems have been developed to measure the loading environment and responses of these bridges in order to assess serviceability and safety while ...
4款美仑美幻的LOADING,总有一款适合你,并且拥有个性化设置,效果一目了然
html 5 +css loding等待效果
Returning 'false' from within the each function completely stops the loop through all of the elements (this is like using a 'break' with a normal loop). Returning 'true' from within the loop skips to ...