随笔分类 -  Program

Some skills in programming!
摘要:PublicFunctionDownloadFileFromWebsite(ByValstrURLAsSystem.String,_ByValstrOutputPathAsSystem.String,_OptionalByValbDisplayProgressAsSystem.Boolean=False)_AsSystem.BooleanDimbSuccessAsSystem.BooleanDimobjWebRequestAsSystem.Net.WebRequest=NothingDimmyWebResponseAsSystem.Net.WebResponse=NothingDimobjOu 阅读全文
posted @ 2012-04-25 18:40 xpwilson 阅读(173) 评论(0) 推荐(0)
摘要:usemaster;alter database aaa set single_user with rollback immediate;drop database aaa死锁:DELETE FROM dow WITH(XLOCK) 阅读全文
posted @ 2012-03-13 17:17 xpwilson 阅读(169) 评论(0) 推荐(0)
摘要:<script language="javascript">function addclick() {//点击触发addclick事件 var txtuserName = $("#txtuserName").val();//用jquery获取id为txtuserName的页面标记的value,存放在txtuserName变量里 $.ajax({ type: "POST",//ajax的方式为post(get方式对传送数据长度有限制) url: "/AjaxRequest/AddUser.ashx",// 阅读全文
posted @ 2012-02-22 18:17 xpwilson 阅读(422) 评论(0) 推荐(0)
摘要:usingSystem;usingSystem.Text;usingSystem.IO;usingSystem.IO.Compression;namespace努力偷懒.Commonds{///<summary>///使用系统默认压缩流的方法进行压缩并保存成文件,///约定1:文件前面8个字节保存的是long类型,存储的是字符串压缩前的字节长度。///</summary>publicclassZipFileHelper{publicstaticlongWriteString(stringfileName,stringdata){longlResult=0;byte[]b 阅读全文
posted @ 2012-02-21 21:23 xpwilson 阅读(1025) 评论(0) 推荐(0)
摘要:[System.Runtime.InteropServices.DllImport("user32.dll")]privatestaticexternboolShowWindow(IntPtrhWnd,intnCmdShow);privateconstintSW_MINIMIZE=6;privateconstintSW_MAXIMIZE=3;privateconstintSW_RESTORE=9;[STAThread]staticvoidMain(string[]args){IntPtrwinHandle=System.Diagnostics.Process.GetCurr 阅读全文
posted @ 2012-02-17 13:28 xpwilson 阅读(241) 评论(0) 推荐(0)
摘要:In top page: <script type="text/javascript" language="javascript"> function changedSouce() { var left=window.parent.window.document.getElementById("two"); left.src = "right.aspx"; var content=window.parent.window.document.getElementById("three" 阅读全文
posted @ 2012-01-16 20:40 xpwilson 阅读(1323) 评论(0) 推荐(0)
摘要:PublicFunctionGetFromRegistry(ByRefKeyAsSystem.String,ByRefSubKeyAsSystem.String)AsSystem.StringDimstrResultAsSystem.String=""TryDimobjUserKeyAsMicrosoft.Win32.RegistryKey=Microsoft.Win32.Registry.LocalMachineDimobjSoftwareKeyAsMicrosoft.Win32.RegistryKey=objUserKey.OpenSubKey("Softwa 阅读全文
posted @ 2012-01-11 16:21 xpwilson 阅读(276) 评论(0) 推荐(0)
摘要:functionchoose_date_czw(date_id,objtd){if(date_id=="choose_date_czw_close"){document.getElementById("choose_date_czw_id").style.display="none";return;}if(objtd!=undefined){if(objtd=="choose_date_czw_empty"){document.getElementById(date_id).value="";} 阅读全文
posted @ 2011-12-14 17:51 xpwilson 阅读(307) 评论(0) 推荐(0)
摘要:1.Singleton:保持一个实例,多线程中要注意。需要lock(object);2.AbstractFactory:工厂的目的就是制造产品,在添加新产品的过程中如何更好的组织管理; 阅读全文
posted @ 2011-12-06 18:30 xpwilson 阅读(122) 评论(0) 推荐(0)
摘要:stringtimestr="";DateTimedt=DateTime.Now;timestr=dt.ToString(); //2011-12-0516:32:26timestr=dt.ToShortDateString(); //2005-11-5timestr=dt.ToShortTimeString(); //16:32timestr=dt.ToLongDateString(); //2011-12-05timestr=dt.ToLongTimeString(); //16:32:26timestr=string.Format("{0:yyyy-HH-d 阅读全文
posted @ 2011-12-06 17:31 xpwilson 阅读(154) 评论(0) 推荐(0)
摘要:Http定义了与服务器交互的不同方法,最基本的方法有4种,分别是GET,POST,PUT,DELETE。URL全称是资源描述符,我们可以这样认为:一个URL地址,它用于描述一个网络上的资源,而HTTP中的GET,POST,PUT,DELETE就对应着对这个资源的查,改,增,删4个操作。到这里,大家应该有个大概的了解了,GET一般用于获取/查询资源信息,而POST一般用于更新资源信息。 1.根据HTTP规范,GET用于信息获取,而且应该是安全的和幂等的。 (1).所谓安全的意味着该操作用于获取信息而非修改信息。换句话说,GET 请求一般不应产生副作用。就是说,它仅仅是获取资源信息,就像数据库.. 阅读全文
posted @ 2011-12-01 14:31 xpwilson 阅读(256) 评论(0) 推荐(0)
摘要:staticvoidCollectFiles(DirectoryInfodir){if(ExcludeFolders.Contains(dir.Name)){return;}FileSystemInfo[]SystemFiles=dir.GetFileSystemInfos();if(SystemFiles.Length==0){return;}else{foreach(varfileindir.GetFiles("*.bak")){FileList.Add(file);}foreach(varfolderindir.GetDirectories()){CollectFil 阅读全文
posted @ 2011-11-28 12:48 xpwilson 阅读(122) 评论(0) 推荐(0)
摘要:DimstrUrlAsString="http://www.mtsindices.com/datafiles/index_fixing/1730/eMTX_1730.xls"DimfilenameAsSystem.String="C:\Xignite\Services\Rates\MTX\today.xls"DimpathAsString="C:\Xignite\Services\Rates\MTX\"DimdtAsNewSystem.Data.DataTableDimstrDateAsSystem.String=NothingIf( 阅读全文
posted @ 2011-11-19 15:12 xpwilson 阅读(206) 评论(0) 推荐(0)
摘要:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Xml;usingSystem.Xml.Linq;namespaceConsoleApplication2{classOperateXML{XmlDocumentxmldoc;XmlNodexmlnode;XmlElementxmlelem;publicvoidCreateDocByDoc(){xmldoc=newXmlDocument();XmlDeclarationxDecl=xmldoc.CreateXmlDe 阅读全文
posted @ 2011-08-26 18:48 xpwilson 阅读(234) 评论(0) 推荐(0)
摘要:function sortCol(cId) { return function compareTRs(tr1, tr2) { var value1 = tr1.cells[cId].firstChild.nodeValue; var value2 = tr2.cells[cId].firstChild.nodeValue; return value1.localeCompare(value2); ... 阅读全文
posted @ 2010-08-13 16:58 xpwilson 阅读(181) 评论(0) 推荐(0)
摘要:T-SQL对字符串的处理能力比较弱,比如我要循环遍历象1,2,3,4,5这样的字符串,如果用数组的话,遍历很简单,但是T-SQL不支持数组,所以处理下来比较麻烦。下边的函数,实现了象数组一样去处理字符串。一,用临时表作为数组。createfunctionf_split(@cvarchar(2000),@splitvarchar(2))returns@ttable(colvarchar(20))as... 阅读全文
posted @ 2010-07-16 09:59 xpwilson 阅读(135) 评论(0) 推荐(0)
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->publicpartialclassImagePanel:UserControl{privateconstfloatREGION_BORDER_SIZE=1.0f;privateImagem_image;privatefloatm_zoomRate;PointFm_displayLocation;privateboolm_isInMoving;privatePointFm_mouseDown 阅读全文
posted @ 2010-03-31 18:30 xpwilson 阅读(240) 评论(0) 推荐(0)
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->//Intheajaxpage,overridetheRendermethod,afterbind,itcanResponsethehtmlbacktothepageprotectedoverridevoidRender(HtmlTextWriterwriter){HtmlTextWriterhtmlWriter=newHtmlTextWriter(newSystem.IO.StringWr 阅读全文
posted @ 2010-01-29 18:11 xpwilson 阅读(143) 评论(0) 推荐(0)
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--protectedvoidexport_Click(objectsender,EventArgse){BusinessLayerbl=newBusinessLayer();DataTabledt=bl... 阅读全文
posted @ 2010-01-26 16:08 xpwilson 阅读(171) 评论(1) 推荐(0)
摘要:using (XmlReader reader = XmlReader.Create(@"D:\Study_Doc\testPro\ConsoleApplication1\ConsoleApplication1\070370561.xml")){while (reader.Read()){if (reader.NodeType == XmlNodeType.Element){if (reader.... 阅读全文
posted @ 2009-06-10 09:59 xpwilson 阅读(170) 评论(0) 推荐(0)