上一页 1 2 3 4 5 6 7 8 ··· 16 下一页
摘要: 1 constintGB=1024*1024*1024;//定义GB的计算常量2constintMB=1024*1024;//定义MB的计算常量3constintKB=1024;//定义KB的计算常量4publicstringByteConversionGBMBKB(Int64KSize)5{6if(KSize/GB>=1)//如果当前Byte的值大于等于1GB7return(Math.Round(KSize/(float)GB,2)).ToString()+"GB";//将其转换成GB8elseif(KSize/MB>=1)//如果当前Byte的值大于等于1M 阅读全文
posted @ 2013-05-18 15:35 yellowshorts 阅读(15223) 评论(0) 推荐(0) 编辑
摘要: 水仙花数的算法是一个三位数每一位数的立方相加等于该数本身1protectedvoidButton1_Click(objectsender,EventArgse) 2 {3inta=0,b=0,c=0;//定义变量4ListBox1.Items.Clear();//清空ListBox1控件5for(inti=100;i<=1000;i++)//遍历所有3位数6{7a=i/100;//获取3位数中的第一个数8Math.DivRem(i,100,outb);//获取3位数中的后两位数9b=b/10;//获取3位数中的第二位数10Math.DivRem(i,10,outc);//获取3位数中的第 阅读全文
posted @ 2013-05-18 15:33 yellowshorts 阅读(4626) 评论(0) 推荐(0) 编辑
摘要: 1protectedvoidButton1_Click(objectsender,EventArgse)2{3ListBox1.Items.Clear();//清空ListBox控件4intp=0,n=0,a=1,b=1;//定义变量5try6{7p=Convert.ToInt32(TextBox1.Text);//将字符型转换成数值型8}9catch//出现错误10{11Response.Write("<script>alert('请输入数值型数据');</script>");12TextBox1.Text="15&quo 阅读全文
posted @ 2013-05-18 15:28 yellowshorts 阅读(1773) 评论(0) 推荐(0) 编辑
摘要: 1if(TextBox1.Text.Length>8)2{3TextBox1.Text=TextBox1.Text.Substring(0,8);4}5else6{7intj=8-TextBox1.Text.Length;8for(inti=0;i<j;i++)9{10TextBox1.Text="0"+TextBox1.Text;11}12} 阅读全文
posted @ 2013-05-18 15:14 yellowshorts 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 1.aspx页面1<div>2<table>3<tr>4<td>5<asp:LabelID="Label1"runat="server"Text="字符串"Font-Size="10pt"></asp:Label>6</td>7<td>8<asp:TextBoxID="TextBox1"runat="server"></asp:TextBox>9</t 阅读全文
posted @ 2013-05-18 15:10 yellowshorts 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 11classProgram2{3staticvoidMain(string[]args)4{5int[]iArrary=newint[]{1,5,13,6,10,55,99,2,87,12,34,75,33,47};6ShellSortersh=newShellSorter();7sh.Sort(iArrary);8for(intm=0;m<iArrary.Length;m++)9Console.Write("{0}",iArrary[m]);10Console.ReadLine();11}12}2.1classShellSorter2{3///<summar 阅读全文
posted @ 2013-05-17 14:29 yellowshorts 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 1.1classProgram2{3staticvoidMain(string[]args)4{5int[]iArrary=newint[]{1,13,3,6,10,55,98,2,87,12,34,75,33,47};6InsertionSorterii=newInsertionSorter();7ii.Sort(iArrary);8for(intm=0;m<iArrary.Length;m++)9Console.Write("{0}",iArrary[m]);10Console.ReadLine();11}12}2.1classInsertionSorter2{3 阅读全文
posted @ 2013-05-17 14:27 yellowshorts 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 1.1classProgram2{3staticvoidMain(string[]args)4{5int[]iArrary=newint[]{1,5,3,6,10,55,9,2,87,12,34,75,33,47};6SelectionSorterss=newSelectionSorter();7ss.Sort(iArrary);8for(intm=0;m<iArrary.Length;m++)9{10Console.Write("{0}",iArrary[m]);11}12Console.ReadLine();13 }14}2.选择排序1classSelection 阅读全文
posted @ 2013-05-17 14:24 yellowshorts 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 主程序入口classProgram{staticvoidMain(string[]args){int[]iArrary=newint[]{1,5,13,6,10,55,99,2,87,12,34,75,33,47};//定义数组BubbleSortersh=newBubbleSorter();sh.Sort(iArrary);for(intm=0;m<iArrary.Length;m++)//输出结果Console.Write("{0}",iArrary[m]);Console.ReadLine();} }冒泡排序方法1classBubbleSorter2{3///& 阅读全文
posted @ 2013-05-17 14:20 yellowshorts 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 大家在很多地方都会遇到诸如此类的问题,如:在一个组织中,从高层领导到中层领导到普通职工,有着一种分级的关系,这些关系在关系型数据库中表示时,有它特别的方法。有些人把它们分别建立在不同的表中,建立相应的关系,这虽然是一种解决办法,但如果在应用中,它会给软件带来诸多不便,特别是程序健壮性方法,如果此时需要多加一个职位,这种解决办法就需要多加一张表,那此时对应用程序的改动将可想而知。我在此处提供的方法并不是什么独特的方法,而是大家所属知的方法,但在我们的论坛上经常有人问到并且我再三进行解答。因此我一方面将这些帖的问题收集一下,再加上全面的解释,组织成这样一篇文章,希望对大家有所帮助。如有不正确之处请 阅读全文
posted @ 2013-04-23 15:40 yellowshorts 阅读(1552) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 16 下一页