做了2天 ,查了N多資料,終於做出來的,放在後台,再發文章 直接複製粘貼過來,就會把文章中的詞用我無敵的17000同義字進行一次替換,這裡採用了access資料庫,百度,google基本就認不出來了,做到真正的偽原創 !
明天做採集,採集後自動替換的!
public string Dealword(string cnt)//偽原創函數,tao2581 zhentou.net<br /> {<br /> string temp=cnt;<br /> // temp="test";<br /> //建立資料庫連接<br /> OleDbConnection aConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+System.Web.HttpContext.Current.Server.MapPath("Tyc.mdb")); </p><p> //建立command對象並儲存sql查詢語句<br /> OleDbCommand aCommand = new OleDbCommand("select * from tb ", aConnection);<br /> aConnection.Open(); </p><p> //建立datareader<br /> OleDbDataReader aReader = aCommand.ExecuteReader(); </p><p> //迴圈遍曆資料庫<br /> while(aReader.Read())<br /> {<br /> temp= Regex.Replace(temp,aReader["tid1"].ToString(),aReader["tid2"].ToString());<br /> }<br /> aReader.Close(); </p><p> //關閉串連,這很重要<br /> aConnection.Close(); </p><p> return temp;<br /> }</p><p>