C#Winform不重复的显示子窗体

private void 窗口1ToolStripMenuItem_Click(object sender, EventArgs e) { //方式1:子窗体会重复打开 //FrmChild1 child1 = new FrmChild1(); //child1.MdiParent = this; …… 阅读全文

C#Winform动态读取App.Config文件

App.Config文件如下: private void Init() { string node = "Version"; this.labVersion.Text = ConfigurationManager.AppSettings[node].ToString(); } …… 阅读全文

C#Winform 在DataGridView(SQL Server)中下载和上传文件方法

下载方法: private void DownloadFile(string gl_fileid) { string sql = "select * from files where fileid='" + gl_fileid + "'"; DataTable dt = DBUtil.GetData(sql); …… 阅读全文

C#Winform向数据库中导入.txt或者.CSV文件的数据

protected void ImportData(string filePath) { if (filePath.Length == 0) { MessageBox.Show("请选择要导入的txt文件"); } using (FileStream f …… 阅读全文

C#Winform在数据库中读取图片文件和上传数据文件

读取数据库图片字段方法: protected void LoadPicture() { Image img = null; if (this.gl_studentid.Length==0) { img = Image.FromFile("NoPicture.png");//如 …… 阅读全文

C#Winform 各种控件缩写总结

标准控件1 btn Button2 chk CheckBox3 ckl CheckedListBox4 cmb ComboBox5 dtp DateTimePicker6 lbl Label7 llb LinkLabel8 lst ListBox9 lvw ListView10 mtx MaskedTextBox11 cdr MonthCalendar12 icn No …… 阅读全文