資源簡介
c#編寫的在線教學系統源碼,可以直接用vs打開參考源碼
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Diagnostics;
using?System.Drawing;
using?System.IO;
using?System.Net;
using?System.Text;
using?System.Text.Regularexpressions;
using?System.Windows.Forms;
namespace?FrmWebTest
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?btnSearch_Click(object?sender?EventArgs?e)
????????{
????????????string?url?=?“http://www.qixin.com“;
????????????HttpHelper?hh?=?new?HttpHelper();
????????????CookieCollection?ccl?=?hh.GetCookieCollection(url);
????????????CookieContainer?cc?=?new?CookieContainer();
????????????cc.Add(ccl);
????????????string?key?=?txtSearch.Text.Trim();
????????????//拼接url
????????????string?web1Url?=?string.Format(url?+?“/search?key={0}&type=enterprise&source=&isGlobal=Y“?key);
????????????//綁定瀏覽器
????????????this.webBrowser1.Url?=?new?Uri(web1Url);
????????????//獲取html
????????????string?str?=?hh.GetHtml(web1Url
?????????????????cc?““?false?““);
????????????//str?=?File.ReadAllText(“d:/mzq.html“?Encoding.UTF8);
????????????//獲取查詢的連接
????????????string[]?htmlarr?=?GetHtmlUrlList(str?key);
????????????if?(htmlarr.Length?==?1)
????????????{
????????????????//保存內容
????????????????File.WriteAllText(“d:/mzq.html“?str);
????????????????//拼接詳細頁的url
????????????????string?detailUrl?=?url?+?htmlarr[0];
????????????????//綁定詳細頁到瀏覽器2
????????????????this.webBrowser2.Url?=?new?Uri(detailUrl);
????????????????//獲取詳細頁html
????????????????string?detailHtml?=?hh.GetHtml(detailUrl?cc?““?false?““);
????????????????//將內容保存到html文件
????????????????File.WriteAllText(“d:/mzqdetail.html“?detailHtml);
????????????????//獲取html中指定內容
????????????????string?getdetails?=?GetContent(detailHtml);
????????????????//顯示到頁面
????????????????this.textBox1.Text?=?getdetails;????????????????
????????????}
????????????else
????????????{
????????????????foreach?(var?item?in?htmlarr)
????????????????{
????????????????????Debug.WriteLine(item);
????????????????}
????????????}
????????}
????????///??
????????///?取得HTML中所有圖片的?URL。?
????????///? ?
????????///?HTML代碼?
????????///?圖片的URL列表 ?
????????public?string[]?GetHtmlUrlList(string?sHtmlText?string?searchKey)
????????{
????????????Regex?regImg?=?new?Regex(string.Format(“(?is)]*?href=([‘\“\“]?)(?[^‘\“\“\\s>]+)\\1[^>]*>{0} “?searchKey)?RegexOptions.Multiline);
????????????//?搜索匹配的字符串?
????????????MatchCollection?matches?=?regImg.Matches(sHtmlText);
????????????int?i?=?0;
????????????string[]?sUrlList?=?new?string[matches.Count];
????????????//?取得匹配項列表?
????????????foreach?(Match?match?in?matches)
????????????{
????????????????sUrlList[i++]?=?match.Groups[“url“].Value;
????????????????//sUrlList[i++]?=?match.Value;
????????????}
???????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-11-02?22:53??破解程序2016年9月21日+004902\
?????目錄???????????0??2016-09-20?23:26??破解程序2016年9月21日+004902\GenericClass.Lib\
?????目錄???????????0??2016-09-20?11:03??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\
?????文件????????7291??2016-06-23?11:29??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\Form1.Designer.cs
?????文件????????3631??2016-07-14?15:56??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\Form1.cs
?????文件????????5817??2016-06-23?11:29??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\Form1.resx
?????文件????????3624??2016-06-23?11:20??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\FrmWebTest.csproj
?????文件???????62835??2016-06-23?13:18??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\FrmWebTest.rar
?????文件???????18867??2016-06-23?11:23??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\HttpHelper.cs
?????文件?????????471??2016-06-23?11:16??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\Program.cs
?????目錄???????????0??2016-09-20?11:03??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\Properties\
?????文件????????1328??2016-06-23?11:16??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\Properties\AssemblyInfo.cs
?????文件????????2833??2016-06-23?11:16??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\Properties\Resources.Designer.cs
?????文件????????5612??2016-06-23?11:16??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\Properties\Resources.resx
?????文件????????1097??2016-06-23?11:16??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\Properties\Settings.Designer.cs
?????文件?????????249??2016-06-23?11:16??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\Properties\Settings.settings
?????目錄???????????0??2016-09-20?11:03??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\bin\
?????目錄???????????0??2016-09-20?11:03??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\bin\Debug\
?????文件???????18944??2016-09-21?00:34??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\bin\Debug\FrmWebTest.exe
?????文件???????46592??2016-09-21?00:34??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\bin\Debug\FrmWebTest.pdb
?????文件???????21680??2016-07-14?15:04??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\bin\Debug\FrmWebTest.vshost.exe
?????文件?????????490??2015-10-30?15:19??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\bin\Debug\FrmWebTest.vshost.exe.manifest
?????目錄???????????0??2016-09-20?11:03??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\obj\
?????目錄???????????0??2016-09-21?00:34??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\obj\Debug\
?????文件????????1230??2016-06-23?13:17??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件????????6139??2016-09-20?23:14??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件?????????180??2016-06-23?11:29??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\obj\Debug\FrmWebTest.Form1.resources
?????文件?????????180??2016-06-23?11:20??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\obj\Debug\FrmWebTest.Properties.Resources.resources
?????文件????????1356??2016-09-21?00:34??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\obj\Debug\FrmWebTest.csproj.FileListAbsolute.txt
?????文件?????????847??2016-06-23?11:29??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\obj\Debug\FrmWebTest.csproj.GenerateResource.Cache
?????文件????????1449??2016-09-21?00:34??破解程序2016年9月21日+004902\GenericClass.Lib\FrmWebTest\obj\Debug\FrmWebTest.csprojResolveAssemblyReference.cache
............此處省略1608個文件信息
評論
共有 條評論