摸板的讀取,儲存

2021-04-03 02:39:54 字數 2381 閱讀 7116

using system;

using system.data;

using system.text;

namespace demo.business

}

public string title

set}

public string content

set}

public string author

set}

public datetime pubdate

}

public string pagepath

set}

public string adminid

set}

#endregion

private article()

#region article 靜態方法

public static article createfromid(int articleid)

article.articleid = int.parse(dt.rows[0]["articleid"].tostring());

article.adminid = dt.rows[0]["adminid"].tostring();

article.title = dt.rows[0]["title"].tostring();

article.content = dt.rows[0]["content"].tostring();

article.author = dt.rows[0]["author"].tostring();

article.pubdate = datetime.parse(dt.rows[0]["pubdate"].tostring());

article.pagepath = dt.rows[0]["pagepath"].tostring();

return article;

}

public static int addarticle(string title, string content, string author, string adminid)

public static int delarticle(int articleid)

public static datatable getarticlelist(int count)

#endregion

#region article 例項方法

public int update()

public void biuldpage()

}", this.title);

pagetext = pagetext.replace("}", this.author);

pagetext = pagetext.replace("}", this.pubdate.tostring());

pagetext = pagetext.replace("}", this.content);

system.io.streamwriter writer = new system.io.streamwriter(filename,true, encoding.getencoding("gb2312"));

writer.write(pagetext.tostring());

writer.close();

// 修改資料庫

string sql = "execute buildpage @articleid,'@pagepath'";

sql = sql.replace("@articleid", this.articleid.tostring());

sql = sql.replace("@pagepath", filename);

baseclass.execute(sql);

}

#endregion

}}

Pandas 資料的讀取,儲存

pandas 如果沒有匯入,匯出的操作,那所有的一切資料處理的操作都將毫無意義。將 資料讀取為dataframe物件的方法,主要有倆個函式,倆者並無不同,以我看,要是讀取以.csv字尾的檔案,就用第一個。pd.read csv pd.read table 倆個函式引數設定 sep 拆分資料的字元序列...

mfc中如何讀取,儲存編碼為utf 8的檔案

主要用到兩個api 如下 code snippet wchar t ansitounicode const char str char unicodetoansi const wchar t str wchar t utf8tounicode const char str char unicodet...

C 讀取剪下板 Clipboard 中的資料的方法

c 讀取剪下板 clipboard 中的資料的方法 1 自定義一個類,並且保證它的可序列化的 實現iserializable介面 或者用 serializable 標記 如果有父類,則父類也需要被標記 可以 nonserialized 標記類中不想被序列化的欄位 2 註冊自定義資料格式 呼叫靜態方法...