资源简介
这是一款C#开发的模拟登陆百度程序,是当前互联网上唯一可用的程序,可以实现对百度的登陆,也可以继续开发实现百度知道和百度文库的每日签到等。
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.IO;
using System.Text.Regularexpressions;
using System.Web;
namespace emulateLoginBaidu
{
public partial class frmEmulateLoginBaidu : Form
{
bool isget = false;
CookieCollection curCookies = null;
string codestring = ““;
bool gotCookieBaiduid extractTokenValueOK loginBaiduOk;
public string getcodestring(string data)
{
string result = Regex.Match(data “(?<=codestring=).*?(?=&)“).Value;
return result;
}
public static string GetTimeStamp()
{
System.DateTime time = System.DateTime.Now;
long ts = ConvertDateTimeToInt(time);
return ts.ToString();
}
private static long ConvertDateTimeToInt(System.DateTime time)
{
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970 1 1 0 0 0 0));
long t = (time.Ticks - startTime.Ticks) / 10000; //除10000调整为13位
return t;
}
public Bitmap LoadImg(string ImageUrl)
{
try
{
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(ImageUrl);
//add follow code to handle cookies
req.CookieContainer = new CookieContainer();
req.CookieContainer.Add(curCookies);
req.Method = “GET“;
//use request to get response
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
//got returned html
//获取流
Bitmap bt = Bitmap.FromStream(resp.GetResponseStream()) as Bitmap;
return bt;
}
catch
{
return null;
}
// return null;
}
public frmEmulateLoginBaidu()
{
InitializeComponent();
}
private void frmEmulateLoginBaidu_Load(object sender EventArgs e)
{
//init
curCookies = new CookieCollection();
gotCookieBaiduid = false;
extractTokenValueOK = false;
loginBaiduOk = false;
}
/******************************************************************************
functions in crifanLib.cs
*******************************************************************************/
//quote the input dict values
//note: the return result for first para no ‘&‘
public string quoteParas(Dictionary paras)
{
string quotedParas = ““;
bool isFirst = true;
string val = ““;
foreach (string para
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-04-27 13:24 模拟登陆百度\
目录 0 2012-11-07 14:23 模拟登陆百度\emulateLoginBaidu\
目录 0 2012-11-07 14:35 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\
文件 893 2012-11-07 14:23 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu.sln
文件 22016 2018-04-27 15:28 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu.suo
文件 117 2012-11-07 14:24 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\app.config
目录 0 2012-11-07 14:23 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\bin\
目录 0 2018-04-27 15:28 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\bin\Debug\
文件 27136 2018-04-27 15:28 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\bin\Debug\emulateLoginBaidu.exe
文件 117 2012-11-07 14:24 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\bin\Debug\emulateLoginBaidu.exe.config
文件 32256 2018-04-27 15:28 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\bin\Debug\emulateLoginBaidu.pdb
文件 11608 2018-04-27 15:28 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\bin\Debug\emulateLoginBaidu.vshost.exe
文件 117 2012-11-07 14:24 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\bin\Debug\emulateLoginBaidu.vshost.exe.config
文件 490 2013-06-18 20:28 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\bin\Debug\emulateLoginBaidu.vshost.exe.manifest
目录 0 2012-11-07 14:23 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\bin\Release\
文件 4286 2012-11-07 14:34 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\crifan.ico
文件 2038 2012-11-07 14:33 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\crifan.png
文件 3848 2012-11-07 16:02 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\emulateLoginBaidu.csproj
文件 13824 2018-04-27 15:28 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\frmEmulateLoginBaidu.cs
文件 8731 2018-04-27 15:28 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\frmEmulateLoginBaidu.Designer.cs
文件 12743 2018-04-27 15:28 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\frmEmulateLoginBaidu.resx
目录 0 2012-11-07 14:23 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\obj\
目录 0 2012-11-07 14:23 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\obj\x86\
目录 0 2018-04-27 15:28 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\obj\x86\Debug\
文件 1229 2018-04-27 15:28 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 5778 2018-04-27 15:28 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 1305 2018-04-27 15:28 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\obj\x86\Debug\emulateLoginBaidu.csproj.FileListAbsolute.txt
文件 990 2018-04-27 15:28 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\obj\x86\Debug\emulateLoginBaidu.csproj.GenerateResource.Cache
文件 1447 2018-04-27 15:28 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\obj\x86\Debug\emulateLoginBaidu.csprojResolveAssemblyReference.cache
文件 27136 2018-04-27 15:28 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\obj\x86\Debug\emulateLoginBaidu.exe
文件 4852 2018-04-27 15:28 模拟登陆百度\emulateLoginBaidu\emulateLoginBaidu\obj\x86\Debug\emulateLoginBaidu.frmEmulateLoginBaidu.resources
............此处省略11个文件信息
- 上一篇:Halcon联合C#模板匹配MVSDK采集
- 下一篇:企业电话客服系统 C# 源码
评论
共有 条评论