摘要:
不是数字,是字符串前位补0哦。。就需要下面这个了。否则用format函数即可。 string str = svalue.PadLeft(4, '0'); 阅读全文
摘要:
1.更改.sln 1)将Microsoft Visual Studio Solution File, Format Version 12.00 改成11.00 2)将 # Visual Studio 2013 VisualStudioVersion = 12.0.21005.1 改成 10.0.40 阅读全文
摘要:
C#简单实现发送手机短信 偶然想起,像编写一个从电脑向手机发送短信的程序,从网上查找到有三种方式:(1)使用webservice接口发送手机短信,这个可以使用sina提供的webservice进行发送,但是需要进行注册;(2)使用短信mao的方式进行短信的发送,这种方式应该是比较的常用,前提是需要购 阅读全文
摘要:
DataGridView动态添加列必须指定列的类型DataGridViewTextBoxColumn Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();Column1.HeaderText =“Column1”;Column1.Name = "Column1";dataGridView1.Columns.Insert(iColIndex, Column1);private void dataGridView1_CellClick(object sender, DataGridViewCellEven 阅读全文
摘要:
备份: string Constr = “Provider=SQLOLEDB;Data Source=.;Integrated Security=SSPI;Initial Catalog=数据库名”;//.代表本机 OleDbConnection myConn = new OleDbConnection(Constr);myConn.Open();OleDbCommand cmd = new OleDbCommand();cmd.Connection = myConn; cmd.CommandText = @"backup database 要备份的数据库名 to disk = &# 阅读全文
摘要:
今天发现一个不错的帖子。转到自己的博客,收藏。要了解vc中使用#include命令包含头文件所搜寻的路径,必须先了解vc中的几种路径:1. 系统路径系统路径在vc中是"Tools->Options->Directories"中"Include files"指定的路径。打开此对话框会发现默认有这几条路径:C:\Program Files\Microsoft Visual Studio\VC98\INCLUDEC:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDEC:\Program F 阅读全文
摘要:
利用线程关闭已开启的应用程序,代码如下:using System.Diagnostics; public void CloseSoundApp() { Process[] pProcess; pProcess = Process.GetProcesses(); for (int i = 1; i <= pProcess.Length - 1; i++) { if (pProcess[i].P... 阅读全文
摘要:
string strDate="2009-05-10"; string[] str = strDate.Split('-');foreach (string i in str){//代码 } 阅读全文
摘要:
当From上或者Panel上想像VB一样循环为控件赋值时可用到以下代码Label[] lbl_Ctrl; lbl_Ctrl= new Label[9]; for (int i = 1; i <= 8; i++){lbl_Ctrl[i] = new Label();lbl_Ctrl[i] = (Label)this.Panel1.Controls["Label" + i.ToString()]... 阅读全文
摘要:
同图片的二进制转换雷同。就是在页面上多加了显示视频控件的代码.详细内容可参照http://blog.csdn.net/qbb3050466/archive/2009/02/11/3876421.aspx 我的简单代码如下:aspx 中: <object id="nsPlayer" classid="clsid:05589FA1-C356-11CE-BF01-00AA0055595A" wid... 阅读全文