摘要: publicboolIsConnected(){SqlConnectionconnection=newSqlConnection(connectionString);//connectionString数据库连接字符串try{if(connection.State!=ConnectionState.Open){connection.Open();}returntrue;}catch{returnfalse;}} 阅读全文
posted @ 2012-07-04 23:37 盈不足 阅读(165) 评论(0) 推荐(0) 编辑
摘要: //在Form1窗体中,按钮事件中,Form2form=newForm2();form.FormBorderStyle=FormBorderStyle.None;form.TopLevel=false;//指示子窗体非顶级窗体this.panel1.Controls.Add(form);//将子窗体载入form.Show(); 阅读全文
posted @ 2012-07-04 21:16 盈不足 阅读(138) 评论(0) 推荐(0) 编辑
摘要: public class WindowHelper { public static void ShowTime(object userData) { int oldX = Console.CursorLeft; int oldY = Console.CursorTop; Console.SetCursorPosition(0, 0); Console.Write(DateTime.Now.ToLongTimeString()); Console.CursorLeft = oldX; Console.CursorTop = oldY; } } class Program { static v.. 阅读全文
posted @ 2012-05-16 18:35 盈不足 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 输入:abcabcabc输出:3classProgram{staticvoidMain(string[]args){stringstr="abcdfabcdfabcdfabcdfabcdfabcdf";string[]substr=newstring[100];stringsubstrValue;boolsame=false;for(inti=0;i<str.Length;i++){if(str.Length%(i+1)==0&&i!=0){intj=0;intk=0;while(k+i<str.Length){substr[j]=str.Sub 阅读全文
posted @ 2012-05-09 00:46 盈不足 阅读(314) 评论(0) 推荐(0) 编辑
摘要: 在n*n的方阵填入1,2,3……n*n.最后形成蛇形。例如n=4时的方阵为:其中(n<=8)10 11 12 19 1613 28 15 14 37 6 5 4源程序如下:usingSystem;namespaceTestConsole{classProgram{staticvoidMain(string[]args){int[,]snake=newint[9,9];Console.Write("Input:");intn=int.Parse(Console.ReadLine());intx=0;inty=n-1;snake[x,y]=1;intnumber=1;wh 阅读全文
posted @ 2012-05-08 00:34 盈不足 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 1)弹出新窗体,设置大小 必须用Javascript程序解决,程序片段如下Window.open("abc.aspx","new","height=430,width=550");window.open('send.aspx','newwindow','height=430px,width=550px,top=50,left=30,toolbar=no,menubar=no,scrollbars=no,visizable=no,location=no,status=no');2)Grid 阅读全文
posted @ 2012-03-17 10:56 盈不足 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 1)获取数据表,第五行,第三列。myDataTable.Rows[4][2];2)获取第一行DataRowmyDataRow=myDataTabe.Row[0];myDataRow[4].ToString();//第一行第五个元素(第五列)myDataRow["属性值"]; 阅读全文
posted @ 2012-03-17 01:11 盈不足 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 第一:用一个单个字符分割stringstr="aaa,bbb,ccc";string[]strArr=str.Split(',');第二:用多个单个字符分割stringstr="aajbbkccjddkee";char[]charArr=newchar[]{'j','k'};stringStrArray=str.Split(charArr);第三:用字符串分割stringstr="aajkbbjkccjkddjkee";stringsArr=newstring[]{"js&qu 阅读全文
posted @ 2012-02-13 23:41 盈不足 阅读(432) 评论(0) 推荐(0) 编辑
摘要: 准备工作:新建网站,建立两个页面,index.aspx和backstage.aspx, 在工程目录下新建一个文件夹命名和image,在这里添加一个loading.gif,模拟提交进度一,前台页面代码:在index.aspx中编写 1,在网页要显示数据的地方,添加一个DIV.源代码如下Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><divid="showtext"></div> 2, 添加脚本程序, 阅读全文
posted @ 2010-07-16 14:40 盈不足 阅读(11015) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--/**CreatedbySharpDevelop.*User:Administrator*Date:2010/4/9*Time:15:06*Directions:最大匹配分词算法**Tochanget... 阅读全文
posted @ 2010-04-09 18:22 盈不足 阅读(287) 评论(0) 推荐(0) 编辑