解析ASP.NET實(shí)現(xiàn)數(shù)據(jù)采集_.Net教程
推薦:淺析ASP.Net之C#中的異常處理基礎(chǔ)知識(shí) 程序開(kāi)發(fā)中,數(shù)據(jù)流按照一定的規(guī)律進(jìn)行傳輸,如果用戶和程序之間的交互完全按照預(yù)定的效果運(yùn)行,程序不會(huì)出現(xiàn)問(wèn)題。可以假設(shè)所處理的數(shù)據(jù)都符合要求,通過(guò)界面作格式判定,所有資源都正確,但是為了系統(tǒng)的安全,需要處理存在的隱患,不能對(duì)數(shù)據(jù)安全
這是我自己寫的一個(gè)數(shù)據(jù)采集程序,是采集一個(gè)人才網(wǎng)里面人才的信息,第一次寫B(tài)log,寫的不好不要見(jiàn)笑。
//先按照下面的字段創(chuàng)建一個(gè)數(shù)據(jù)表
以下為引用的內(nèi)容: public partial class Form2 : Form { public Form2() { InitializeComponent(); } //姓名 public static string XM = ""; //年齡 public static string nl = ""; //性別 public static string XB = ""; //身高 public static string SG = ""; //政治面貌 public static string mm = ""; //民族 public static string MZ = ""; //學(xué)歷 public static string XL = ""; //婚姻狀況 public static string HK = ""; //所學(xué)專業(yè) public static string ZY = ""; //工作經(jīng)驗(yàn) public static string GZJY = ""; //在職單位 public static string ZZDW = ""; //在職職位 public static string ZZZW = ""; //工作經(jīng)歷 public static string GZJL = ""; //要求月薪 public static string YX = ""; //工作性質(zhì) public static string GZXZ = ""; //求職意向 public static string QZYX = ""; //具體職務(wù) public static string JTZW = ""; //期望工作地 public static string QWGZD = ""; //教育情況,語(yǔ)言水平,技術(shù)專長(zhǎng) public static string QT = ""; private void button1_Click(object sender, EventArgs e) //遍歷數(shù)據(jù)的頁(yè)數(shù) label1.Text = "恭喜你采集完成!"; //采集數(shù)據(jù) //按照Html里面的標(biāo)簽 取出和數(shù)據(jù)有關(guān)的那段源碼 //生成HtmlDocument foreach (HtmlElement tr in htmlTR) Content(a); //采集詳細(xì)數(shù)據(jù) //按照Html里面的標(biāo)簽 取出和數(shù)據(jù)有關(guān)的那段源碼 HtmlElementCollection htmlTR = HtmlTR_Content(strWeb, "table"); foreach (HtmlElement tr in htmlTR) insert(); //將數(shù)據(jù)插入數(shù)據(jù)庫(kù) OleDbConnection con = new OleDbConnection(str); //返回一個(gè)HtmlElementCollection,然后進(jìn)行查詢內(nèi)容 return htmlTR;
try return strResult; |
//這個(gè)程序?qū)懙牟皇翘茫际怯胒or循環(huán)遍歷出來(lái)的,效率不是太高,那位高手可以使用 多線程 指點(diǎn)一下
分享:ASP.Net網(wǎng)絡(luò)數(shù)據(jù)庫(kù):連接到數(shù)據(jù)庫(kù)1.使用數(shù)據(jù)庫(kù)MyFirstAccessDB 本實(shí)例使用的數(shù)據(jù)庫(kù)名稱為MyFirstAccessDB,版本為Microsoft Access 2003中文版。該數(shù)據(jù)庫(kù)已經(jīng)在1.4.2節(jié)中創(chuàng)建。 2.創(chuàng)建新ASP.NET應(yīng)用程序 在Visual Studio .NET 2003集成開(kāi)發(fā)環(huán)境中創(chuàng)建新的ASP.NET Web應(yīng)用程序,命名為Examp
- asp.net如何得到GRIDVIEW中某行某列值的方法
- .net SMTP發(fā)送Email實(shí)例(可帶附件)
- js實(shí)現(xiàn)廣告漂浮效果的小例子
- asp.net Repeater 數(shù)據(jù)綁定的具體實(shí)現(xiàn)
- Asp.Net 無(wú)刷新文件上傳并顯示進(jìn)度條的實(shí)現(xiàn)方法及思路
- Asp.net獲取客戶端IP常見(jiàn)代碼存在的偽造IP問(wèn)題探討
- VS2010 水晶報(bào)表的使用方法
- ASP.NET中操作SQL數(shù)據(jù)庫(kù)(連接字符串的配置及獲取)
- asp.net頁(yè)面?zhèn)髦禍y(cè)試實(shí)例代碼
- DataGridView - DataGridViewCheckBoxCell的使用介紹
- asp.net中javascript的引用(直接引入和間接引入)
- 三層+存儲(chǔ)過(guò)程實(shí)現(xiàn)分頁(yè)示例代碼
.Net教程Rss訂閱編程教程搜索
.Net教程推薦
- 解讀ASP.NET中使用AJAX中的方式
- 揭秘運(yùn)行 ASP 時(shí)腳本超時(shí)問(wèn)題最終解決辦法
- MVC4 基礎(chǔ) 枚舉生成 DropDownList 實(shí)用技巧
- 解析Asp.net動(dòng)態(tài)生成頁(yè)面控件的辦法
- 如何用asp.net程序備份或還原SQLServer
- 用 asp.net 動(dòng)態(tài)設(shè)置 WebService 引用
- 淺析ASp.Net自定義驗(yàn)證碼控件
- 談.net 中的職責(zé)鏈模式的使用
- 簡(jiǎn)述c#中對(duì)字符串進(jìn)行分割的幾種方法
- 淺談ASP.NET開(kāi)發(fā)下的MVC設(shè)計(jì)模式的實(shí)現(xiàn)
- 相關(guān)鏈接:
- 教程說(shuō)明:
.Net教程-解析ASP.NET實(shí)現(xiàn)數(shù)據(jù)采集。