05 2013 档案
摘要:privatevoidbutton1_Click(objectsender,EventArgse){Dictionary<string,int>dic=newDictionary<string,int>();dic.Add("苹果",30);dic.Add("梨子",15);dic.Add("南瓜",60);inttotal=0;//把几种奖品的属性值加起来。foreach(KeyValuePair<string,int>kvpindic){total+=kvp.Value;}Randomrnd=n
阅读全文
摘要:/// <summary> /// 按比例缩小图片,自动计算高度 /// </summary> /// <param name="stroldpic">源图文件名(包括路径)</param> /// <param name="strnewpic">缩小后保存为文件名(包括路径)</param> /// <param name="intwidth">缩小至宽度</param> public string smallpic(string str
阅读全文
摘要:http://kuro.tw/scratch.html
阅读全文
摘要://************************************************************////下面给出三个简单的方法,后面两个方法是扩展,估计有时用得着//************************************************************///// <summary>/// 缩小图片/// </summary>/// <param name="stroldpic">源图文件名(包括路径)</param>/// <param name="
阅读全文
摘要:sql补零update Promote set PromoteSName=right('000'+cast(PromoteSName as varchar),3)sql去空格update Promote set PromoteSName=ltrim(PromoteSName)
阅读全文
摘要:<script type="text/javascript"> ZeroClipboard.setMoviePath("js/ZeroClipboard.swf"); $(document).ready(function () { $("a[id^=scopy]").each(function () { var clip = new ZeroClipboard.Client(); clip.setHandCursor(true); var obj = $(...
阅读全文
摘要:1、方法一(不可逆加密)publicstringEncryptPassword(stringPasswordString,stringPasswordFormat){stringencryptPassword=null;if(PasswordFormat="SHA1"){encryptPassword=FormsAuthortication.HashPasswordForStoringInConfigFile(PasswordString,"SHA1");}elseif(PasswordFormat="MD5"){encryptPas
阅读全文
摘要:指定一个经纬度,给定一个范围值(单位:千米),查出在经纬度周围这个范围内的数据。经度:113.914619纬度:22.50128范围:2kmlongitude为数据表经度字段latitude为数据表纬度字段SQL在mysql下测试通过,其他数据库可能需要修改SQL语句如下:Java代码select*fromlocationwheresqrt((((113.914619-longitude)*PI()*12656*cos(((22.50128+latitude)/2)*PI()/180)/180)*((113.914619-longitude)*PI()*12656*cos(((22.50128
阅读全文
摘要:private string GetAbsoluteUri() { int index = Request.Url.AbsoluteUri.LastIndexOf('/'); string path = Request.Url.AbsoluteUri.Substring(0, index + 1); return path; }
阅读全文