首先創建類庫 Model (業務實體層),創建類: NewDina.CS 用於獲取數據庫相應字段名,
Demo如下:
[Copy to clipboard] [ - ]CODE:
public class NewDina
{
#region Fields
private string _news_Title = String.Empty;
private string _news_Content = String.Empty;
private string _news_Time;
#endregion
Public Properties#region Public Properties
public string news_Title
{
get { return _news_Title; }
set { _news_Title = value; }
}
public string news_Content
{
get { return _news_Content; }
set { _news_Content = value; }
}
public string news_Time
{
get { return _news_Time; }
set { _news_Time = value; }
}
#endregion
}
然後再創建一個類inaSet.CS該列用於將搜索的關鍵字放入數組,用於替換關鍵字用,令搜索的關鍵字顯紅色;
Demo如下:
[Copy to clipboard] [ - ]CODE:
public class DinaSet
{
private ArrayList dinarray = new ArrayList();
public ArrayList Dinarray
{
get
{
return dinarray;
}
}
}