资源简介

模拟登陆百度

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.Regularexpressions;
using System.Web;
using Newtonsoft.Json;

namespace BaiduLoginDemo
{
    class Program
    {
        private Regex _regex = new Regex(@“\{.*\}“ RegexOptions.IgnoreCase);
        static void Main(string[] args)
        {
           new Program().Login(“用户名““密码“);
        }

        public void Login(string usernamestring pwd)
        {
            var cookieContainer = new CookieContainer();
            var token = GetToken(cookieContainer);
            if (_regex.IsMatch(token))
                token = _regex.Match(token).Value;
            var resultToken = JsonConvert.Deserializeobject(toke

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-06-09 16:43  BaiduLoginDemo\
     目录           0  2015-06-09 16:40  BaiduLoginDemo\BaiduLoginDemo\
     文件        1011  2015-06-09 16:28  BaiduLoginDemo\BaiduLoginDemo.sln
     文件       25600  2015-06-09 16:44  BaiduLoginDemo\BaiduLoginDemo.v12.suo
     文件        3002  2015-06-09 16:44  BaiduLoginDemo\BaiduLoginDemo\BaiduLoginDemo.csproj
     目录           0  2015-06-09 16:28  BaiduLoginDemo\BaiduLoginDemo\bin\
     目录           0  2015-06-09 16:44  BaiduLoginDemo\BaiduLoginDemo\bin\Debug\
     文件       17920  2015-06-09 16:44  BaiduLoginDemo\BaiduLoginDemo\bin\Debug\BaiduLoginDemo.exe
     文件       19968  2015-06-09 16:44  BaiduLoginDemo\BaiduLoginDemo\bin\Debug\BaiduLoginDemo.pdb
     文件       24216  2015-06-09 16:28  BaiduLoginDemo\BaiduLoginDemo\bin\Debug\BaiduLoginDemo.vshost.exe
     文件         490  2013-06-18 20:28  BaiduLoginDemo\BaiduLoginDemo\bin\Debug\BaiduLoginDemo.vshost.exe.manifest
     文件     1503232  2011-04-07 02:32  BaiduLoginDemo\BaiduLoginDemo\bin\Debug\BouncyCastle.Crypto.dll
     文件      493056  2015-04-22 14:32  BaiduLoginDemo\BaiduLoginDemo\bin\Debug\Newtonsoft.Json.dll
     文件      478726  2015-04-22 14:32  BaiduLoginDemo\BaiduLoginDemo\bin\Debug\Newtonsoft.Json.xml
     目录           0  2015-06-09 16:28  BaiduLoginDemo\BaiduLoginDemo\obj\
     目录           0  2015-06-09 16:44  BaiduLoginDemo\BaiduLoginDemo\obj\Debug\
     文件         470  2015-06-09 16:44  BaiduLoginDemo\BaiduLoginDemo\obj\Debug\BaiduLoginDemo.csproj.FileListAbsolute.txt
     文件       13335  2015-06-09 16:44  BaiduLoginDemo\BaiduLoginDemo\obj\Debug\BaiduLoginDemo.csprojResolveAssemblyReference.cache
     文件       17920  2015-06-09 16:44  BaiduLoginDemo\BaiduLoginDemo\obj\Debug\BaiduLoginDemo.exe
     文件       19968  2015-06-09 16:44  BaiduLoginDemo\BaiduLoginDemo\obj\Debug\BaiduLoginDemo.pdb
     文件        6646  2015-06-09 16:44  BaiduLoginDemo\BaiduLoginDemo\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     目录           0  2015-06-09 16:28  BaiduLoginDemo\BaiduLoginDemo\obj\Debug\TempPE\
     文件        7842  2015-06-09 16:40  BaiduLoginDemo\BaiduLoginDemo\Program.cs
     目录           0  2015-06-09 16:28  BaiduLoginDemo\BaiduLoginDemo\Properties\
     文件        1440  2015-06-09 16:28  BaiduLoginDemo\BaiduLoginDemo\Properties\AssemblyInfo.cs
     文件        4218  2015-06-09 16:29  BaiduLoginDemo\BaiduLoginDemo\RSAHelper.cs
     目录           0  2015-06-09 16:44  BaiduLoginDemo\dll\
     文件     1503232  2011-04-07 02:32  BaiduLoginDemo\dll\BouncyCastle.Crypto.dll

评论

共有 条评论