真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

vb點(diǎn)虐 斷電保存數(shù)據(jù) vbnet recordset

VB點(diǎn)虐 怎樣保存文件

保存文件的步驟為:

創(chuàng)新互聯(lián)公司始終堅(jiān)持【策劃先行,效果至上】的經(jīng)營理念,通過多達(dá)十余年累計超上千家客戶的網(wǎng)站建設(shè)總結(jié)了一套系統(tǒng)有效的全網(wǎng)整合營銷推廣解決方案,現(xiàn)已廣泛運(yùn)用于各行各業(yè)的客戶,其中包括:成都主動防護(hù)網(wǎng)等企業(yè),備受客戶認(rèn)可。

關(guān)閉流,特別是寫入流

關(guān)閉并保存文件

示例代碼如下:

Imports?System.Windows.Forms

Imports?System.IO

Imports?System.Text

Sub?SaveFileDemo()

'打開文件。如果文件不存在則創(chuàng)建新的文件

Dim?myFile?As?New?IO.FileStream("d:\data.txt",?_

FileMode.OpenOrCreate,?_

FileAccess.Write)

'在文件末尾添加一行?

Dim?tw?As?New?StreamWriter(myFile)

myFile.Seek(0,?SeekOrigin.End)

tw.WriteLine("白刃格斗英雄連英模部隊(duì)方隊(duì)亮相閱兵")

'關(guān)閉流

tw.Close()

'關(guān)閉文件并保存文件

myFile.Close()

End?Sub

如何實(shí)現(xiàn)VB.NET退出程序保存設(shè)置

Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed

SaveSetting("appname", "Startup", "text1", TextBox1.Text)

SaveSetting("appname", "Startup", "text2", TextBox2.Text)

End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim text1 As Double

Dim text2 As Double

text1 = GetSetting("appname", "startup", "text1", 8)

text2 = GetSetting("appname", "Startup", "text2", 6)

TextBox1.Text = text1

TextBox2.Text = text2

End Sub

vb點(diǎn)虐 保存數(shù)據(jù)

都是用SQL語句完成的

寫入數(shù)據(jù)庫

strSQL="INTO TABLENAME (OPTION1,OPTIN2)VALUES(VALUE1,VALUE2)";

cmd.Connection = conn;

cmd.CommandText = strSQL;

cmd.Parameters.Add(paramrs[i]);

try

{

conn.Open();

}

catch(Exception ex)

{

throw ex;

}

finally

{

cmd.Parameters.Clear();

cmd.CommandText = null;

cmd.Dispose();

conn.Close();

}

讀取值

strSQL ="SELECT OPTION1,OPTION2 FROM TABLENAME";

cmd.CommandText = strSQL;

cmd.Connection = conn;

DataSet ds = new DataSet();

try

{

conn.Open();

SqlDataAdapter da = new SqlDataAdapter(cmd);

da.Fill(ds);

}

catch (Exception ex)

{

throw ex;

}

finally

{

cmd.Dispose();

conn.Close();

}

TextBox2.text = ds.Tables[0].rows[0][0].value.tostring();


網(wǎng)頁題目:vb點(diǎn)虐 斷電保存數(shù)據(jù) vbnet recordset
網(wǎng)站網(wǎng)址:http://weahome.cn/article/ddjsioh.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部