基本信息
源码名称:WEBBROWER控件使用代理访问指定网页
源码大小:0.47M
文件格式:.rar
开发语言:C#
更新时间:2016-04-23
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
使用Webbrower控件
使用Webbrower控件
private void btnStart_Click(object sender, EventArgs e)
{
try
{
CheckIsNull(txtUrl.Text.Trim(), "视频地址");
if (chkProxy.Checked)
CheckIsNull(txtProxy.Text.Trim(), "代理服务器");
string urlPath = txtUrl.Text.Trim();
string proxyPath = txtProxy.Text.Trim();
string loneyUrl = string.Empty;
List<string> urlList = null;
List<string> proxyList = null;
if (chkImport.Checked)
urlList = GetListFromFile(urlPath);
if (chkProxy.Checked)
proxyList = GetListFromFile(proxyPath);
//string url2 = "http://v.youku.com/v_show/id_XMTUzNDk1MDcwOA==.html?from=s1.8-1-1.2";
//string url1 = "http://v.youku.com/v_show/id_XMTUyNjI3Njg2OA==.html?from=s1.8-1-1.2";
this.cmbType.Enabled = false;
this.btnStart.Enabled = false;
this.btnStop.Enabled = true;
this.labShow.Text = "";
this.labShow.Visible = true;
stoped = false;
int viewType = cmbType.SelectedIndex;
if (!chkImport.Checked)
{
loneyUrl = txtUrl.Text.Trim();
}
ThreadPool.QueueUserWorkItem(delegate(object obj)
{
//UrlMkSetSessionOption(URLMON_OPTION_USERAGENT, useAge, useAge.Length, 0);
while (!stoped)
{
Thread.Sleep(200);
if (!chkImport.Checked)
{
ViewVido(loneyUrl, proxyList);
Thread.Sleep((int)txtSleepTime.Value * 1000);
}
else
{
switch (viewType)
{
case 0:
IndexView(urlList, proxyList);
break;
default:
RandomView(urlList, proxyList);
Thread.Sleep((int)txtSleepTime.Value * 1000);
break;
}
}
}
});
ThreadPool.QueueUserWorkItem(delegate(object obj)
{
while (!stoped)
{
Thread.Sleep(983);
this.labShow.Invoke(new Action(() =>
{
this.labShow.Text = string.Format("总计点击{0}个视频", count);
}));
}
});
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}