摘要:c#winform程序的改名(修改名称) c#windows应用程序一般情况下,是一个文件夹外加一个*.sln文件,项目中的名称要改的话,可以按照如下方法进行: 1、项目右键选择“属性”,选择“应用程序”,修改“程序集名称、默认命名空间、程序集信息”; 2、解决方案、窗体名称可以直接在属性中改; 3
阅读全文
摘要:最近在编写C#代码的过程中,遇到此问题,网上查找资料后,终于解决了此问题。现将解决方法记录下来,以便以后查看。注:此方法未必能解决所有这类问题,仅供参考。 通常在以下情况下会出现这种异常: (1)想要在64的系统上运行32位的应用程序并且没有WOW64(Windows-on-Windows 64-b
阅读全文
摘要:一: int time=0;while(true){Thread. Sleep(1000);time=time+1;Console.Write(time)if(time>=180){//这里放时间到了之后执行的操作,会被循环执行。//不想循环请加break;}} 二: Task.Factory.St
阅读全文
摘要:static void Main(string[] args) { DateTime dt = DateTime.Now; while (true) { DateTime dt2 = DateTime.Now; TimeSpan ts = dt2 - dt; if (ts.Seconds <= 60
阅读全文
摘要:第一种 using System.Drawing; using System.Windows.Forms; namespace WinFormUtilHelpV2 { /// <summary> /// 基于.NET 2.0的Tooltip工具类 /// </summary> public stat
阅读全文
摘要:主要代码 public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Paint(object sender, PaintEventArgs e) { Type(th
阅读全文
摘要:public class CustomLanguage : CultureInfo { public CustomLanguage(string shortDatePattern = "yyyy-MM-dd", string longDatePattern = "yyyy-MM-dd", strin
阅读全文
摘要:label1.Invoke(new MethodInvoker(() => label1.Text = ""));
阅读全文
摘要:一、开篇 程序间通信的主要目的是实现多台计算机(也可以是同一台)中应用程序之间的数据共享与信息交换。在不同的计算机系统中,它们之间要通过网络之间的协议才能 实现数据共享与信息交换;在同一台计算机系统中,它们之间只需一定的通道就能实现数据共享与信息交换。在不同计算机系统和同一计算机系统的程序通信中,既
阅读全文
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;u...
阅读全文
摘要:using System;using System.Collections;using System.Collections.Generic;using System.Data;using System.Data.SqlClient;using System.IO;using System.Refl...
阅读全文
摘要:usingSystem;usingSystem.Data;usingSystem.Xml;usingSystem.Data.SqlClient;usingSystem.Collections;usingSystem.Configuration;namespaceBookDAL{//////SqlSe...
阅读全文
摘要:protected void CreateTreeView() { TreeNode rootNode = new TreeNode(); rootNode.Text = "全部"; rootNode.Value = "...
阅读全文
摘要:SqlConnection conn = new SqlConnection('Server=(local);DataBase=test;User=sa;Pwd=sa');SqlDataAdapter da = new SqlDataAdapter('select * from test',conn...
阅读全文
摘要:1)说明系统存储过程sp_MSforeachtable和sp_MSforeachdb,是微软提供的两个不公开的存储过程,从ms sql 6.5开始。存放在SQL Server的MASTER数据库中。2)参数说明:@command1 nvarchar(2000), --第一条运行的SQL指令@repl...
阅读全文
摘要:1、常用的T-Sql语句 查询:SELECT * FROM tb_test WHERE ID='1' AND name='xia' SELECT * FROM tb_test 插入:INSERT INTO tb_test VALUES('xia','123') INSERT INTO tb_test...
阅读全文
摘要:单行选中foreach (DataGridViewRow dr in this.dataGridView1.Rows) { try { //DataGridViewCheckBoxCell cbx = (DataGridViewCheckBoxCell)dr.Cells[0]; //if ((boo...
阅读全文
摘要:private void FillYearMonth() { List listDateTime = new List(); DateTime dtStart = Convert.ToDateTime("2015-1"); //开始时间 DateTime dtEnd = DateTime.Now;/...
阅读全文
摘要:bool enterkey; protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { enterkey = false; if (keyDat...
阅读全文
摘要:第一种:DataSet ds=new DataSet (); this.dataGridView1.DataSource=ds.Table[0]; 第二种:DataTable dt=new DataTable(); this.dataGridView1.DataSource=dt; 第三种...
阅读全文