摘要: 语法:sccreate|delete|config服务名[参数]主要参数列表: start=demand|boot|system|auto|disabled|delayed-auto //启动类型 binPath=BinaryPathName //可执行文件路径 depend=依存关系(以/(斜杠)分隔) DisplayName=<显示名称> //屏幕显示名称C:\DocumentsandSettings\www.wangxudong.com>tasklist//类似于linux下的ps安装服务sccreateGatewayS... 阅读全文
posted @ 2011-09-20 10:56 MrNobody_123456 阅读(173) 评论(0) 推荐(0) 编辑
摘要: selecta.id,b.nameas字段所属表名,a.nameas字段名,c.name字段属性,d.value字段说明,a.length字段长度,a.xscale字段小数位fromsyscolumnsa,sysobjectsb,systypesc,sys.extended_propertiesdwherea.id=b.idandb.namein(selectnamefromsysobjectswherextype='U')anda.xusertype=c.xusertypeanda.id=d.major_idanda.colid=d.minor_id 阅读全文
posted @ 2011-08-18 11:53 MrNobody_123456 阅读(179) 评论(0) 推荐(0) 编辑
摘要: usingSystem;usingSystem.Collections.Generic;namespaceConsoleApplication3{classProgram{privatestaticList<int>resultList=newList<int>(){0,1};staticvoidMain(string[]args){intnum=89;//给出一个数,使用递归计算出该数前的菲波纳奇数字序列,并判断是否是菲波纳奇数字try{TestMethod(num,resultList.Count-1);foreach(intiteminresultList){Co 阅读全文
posted @ 2011-04-22 14:46 MrNobody_123456 阅读(216) 评论(0) 推荐(0) 编辑
摘要: usingSystem;usingSystem.Threading;usingSystem.ComponentModel;usingSystem.Runtime.InteropServices;namespaceTestEntity{///<summary>///进行精确操作计时的类。///</summary>publicsealedclassRunTime{//-----私有对象[DllImport("Kernel32.dll")]privatestaticexternboolQueryPerformanceFrequency(outlonglpF 阅读全文
posted @ 2011-04-08 17:43 MrNobody_123456 阅读(321) 评论(0) 推荐(0) 编辑
摘要: 在Winform中DataGridView绑定List<T>数据源时,点击DataGridView列头不能自动排序解决方法,自定义集体类:usingSystem.ComponentModel;usingSystem.Collections.Generic;usingSystem.Reflection;usingSystem;publicclassSortableBindingList<T>:BindingList<T>{privateboolisSortedCore=true;privateListSortDirectionsortDirectionCore 阅读全文
posted @ 2011-04-08 10:03 MrNobody_123456 阅读(760) 评论(0) 推荐(0) 编辑
摘要: namespaceMicrosoft.ServiceModel.Samples{usingSystem;usingSystem.ServiceModel;usingSystem.ServiceModel.Description;usingSystem.ServiceModel.Channels;classProgram{staticvoidMain(string[]args){//为服务的基址创建Uri实例。UribaseAddress=newUri("http://localhost:8000/ServiceModelSamples/Service");//创建一个新的S 阅读全文
posted @ 2011-03-27 15:13 MrNobody_123456 阅读(115) 评论(0) 推荐(0) 编辑
摘要: //十进制转二进制Console.WriteLine(Convert.ToString(69,2));//十进制转八进制Console.WriteLine(Convert.ToString(69,8));//十进制转十六进制Console.WriteLine(Convert.ToString(69,16));//二进制转十进制Console.WriteLine(Convert.ToInt32(”100111101″,2));//八进制转十进制Console.WriteLine(Convert.ToInt32(”76″,8));//十六进制转十进制Console.WriteLine(Conver 阅读全文
posted @ 2011-03-27 15:11 MrNobody_123456 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 首先安装微软的Speech Application SDK(SASDK),它的最新版本是SAPI 5.1 他能够识别中、日、英三种语言,你可以在这里下载:http://www.microsoft.com/speech/download/sdk51/需要安装这两个文件Speech SDK 5.1和5.1 Language Pack,其中5.1 Language Pack可以选择安装支持的语言。安装好以后,我们就可以开始进行语音程序的开发了,当然,在这之前我们需要把SAPI.dll通过如下图所示添加到引用中然后可以从控制面版中 语音属性中 选择以下就是中文简单的发音C#代码:privateSpV. 阅读全文
posted @ 2011-03-27 15:07 MrNobody_123456 阅读(476) 评论(0) 推荐(0) 编辑
摘要: [DllImport("user32.dll")]staticexternIntPtrSetParent(IntPtrhWndChild,IntPtrhWndNewParent);[DllImport("user32.dll")]privatestaticexternboolShowWindowAsync(IntPtrhWnd,intnCmdShow);privatevoidbutton1_Click(objectsender,EventArgse){System.Diagnostics.Processp=System.Diagnostics.Proce 阅读全文
posted @ 2011-03-27 15:04 MrNobody_123456 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Console.WriteLine(Environment.GetFolderPath(Environment.SpecialFolder.Personal)); 阅读全文
posted @ 2011-03-27 15:03 MrNobody_123456 阅读(131) 评论(0) 推荐(0) 编辑
摘要: FileInfofileInfo=newFileInfo(fileName);//判断文件是否存在该属性if((fileInfo.Attributes&FileAttributes.System)==FileAttributes.System)fileInfo.Attributes&=~FileAttributes.System;fileInfo.Attributes&=~FileAttributes.Hidden&~FileAttributes.NotContentIndexed&~FileAttributes.ReadOnly; 阅读全文
posted @ 2011-03-27 15:02 MrNobody_123456 阅读(295) 评论(0) 推荐(0) 编辑
摘要: usingSystem;usingSystem.Collections.Generic;usingSystem.Text;namespaceConsoleApplication1{classProgram{staticvoidMain(string[]args){stringstr="Hellomydearfriend.";str.Trim();charc='\0';stringnewStr=string.Empty;for(intk=0;k<str.Length;k++){//ASCII表中大小写字母正好相隔32,在ASCII表中32表示'& 阅读全文
posted @ 2011-03-27 15:02 MrNobody_123456 阅读(334) 评论(0) 推荐(0) 编辑
摘要: usingSystem;usingSystem.CodeDom.Compiler;usingSystem.Reflection;usingSystem.Text;namespaceConsoleApplication2{classProgram{staticvoidMain(string[]args){Programp=newProgram();if(p.CompileCode()){//反射动态编译的程序集DLLstringdllPathName=AppDomain.CurrentDomain.BaseDirectory+@"MyTestClassLibrary.dll" 阅读全文
posted @ 2011-03-27 15:00 MrNobody_123456 阅读(331) 评论(0) 推荐(0) 编辑
摘要: usingSystem;usingSystem.Threading;usingSystem.Windows.Forms;namespaceWindowsFormsApplication1{//定义委托publicdelegatestringTestMethod();publicdelegatevoidAllForm(stringtext);publicpartialclassForm1:Form{AutoResetEventtestEvent=newAutoResetEvent(false);AllForm_allForm=null;publicForm1(){InitializeCompon 阅读全文
posted @ 2011-03-27 14:59 MrNobody_123456 阅读(238) 评论(0) 推荐(0) 编辑
摘要: //获取图片保存目录functionSavePicturePath(){varpicStr="../MyDocuments/MyPictures/SZVID_Picture";varnowTime=newDate();vardatePath=picStr+"/"+nowTime.getFullYear()+"-"+nowTime.getMonth()+"-"+nowTime.getDay();varfso=newActiveXObject("Scripting.FileSystemObject" 阅读全文
posted @ 2011-03-27 14:57 MrNobody_123456 阅读(183) 评论(0) 推荐(0) 编辑
摘要: Linq与SQLServer数据库字段类型映射具体映射关系请参照:http://msdn.microsoft.com/zh-cn/library/bb386947(VS.90).aspx 阅读全文
posted @ 2011-03-27 14:54 MrNobody_123456 阅读(138) 评论(0) 推荐(0) 编辑
摘要: ADD_MONTHS:加月SELECTSYSDATE,ADD_MONTH(SYSDATE,1)FROMDUAL;SYSDATEADD_MONTHS(SYSDATE,1)--------------------------------03-1-816:203-2-816:21:59加日:SQL>SELECTSYSDATE,SYSDATE+1FROMDUAL;SYSDATESYSDATE+1----------------------03-1-816:203-1-916:2------------------------------------------------------------ 阅读全文
posted @ 2011-03-27 14:52 MrNobody_123456 阅读(626) 评论(0) 推荐(0) 编辑
摘要: Oracle关于时间/日期的操作1。日期时间间隔操作当前时间减去7分钟的时间selectsysdate,sysdate-interval‘7‘MINUTEfromdual当前时间减去7小时的时间selectsysdate-interval‘7‘hourfromdual当前时间减去7天的时间selectsysdate-interval‘7‘dayfromdual当前时间减去7月的时间selectsysdate,sysdate-interval‘7‘monthfromdual当前时间减去7年的时间selectsysdate,sysdate-interval‘7‘yearfromdual时间间隔乘以 阅读全文
posted @ 2011-03-27 14:51 MrNobody_123456 阅读(404) 评论(0) 推荐(0) 编辑
摘要: --某一时间段按年分组查询数据SELECTTO_CHAR(A.APPLICATION_DATE,'YYYY')GROUPSTYLE,COUNT(*)DATECOUNTFROMAPPLY_TO_ROADAWHEREA.APPLICATION_DATEBETWEENTO_DATE('2008-06-01','YYYY-MM-DD')ANDSYSDATEGROUPBYTO_CHAR(A.APPLICATION_DATE,'YYYY');--某一时间段按月分组查询数据SELECTTO_CHAR(A.APPLICATION_DATE, 阅读全文
posted @ 2011-03-27 14:49 MrNobody_123456 阅读(601) 评论(0) 推荐(0) 编辑
摘要: --行级触发器增、删、改CREATEORREPLACETRIGGERTRI_SSO_USERSAFTERINSERTORUPDATEORDELETEONUSERSFOREACHROWDECLARETEMP_ROW_COUNTINT;BEGINIF(UPDATINGORINSERTING)THENSELECTCOUNT(*)INTOTEMP_ROW_COUNTFROMSSO_USER_INFOSSOWHERESSO.SSO_USER_ID=:NEW.USER_ID;IF(TEMP_ROW_COUNT>0)THENUPDATESSO_USER_INFOSSOSETSSO.SSO_PASSWO 阅读全文
posted @ 2011-03-27 14:47 MrNobody_123456 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 1. MySQL支持enum和set类型,SQL Server不支持; 2. MySQL不支持nchar、nvarchar、ntext类型; 3. MySQL的递增语句是AUTO_INCREMENT,而MS SQL是identity(1,1); 4. MS SQL默认到处表创建语句的默认值表示是((0)),而在MySQL里面是不允许带两括号的; 5. MySQL需要为表指定存储类型; 6. MS SQL识别符是[],[type]表示他区别于关键字,但是MySQL却是 `,也就是按键1左边的那个符号; 7. MS SQL支持getdate()方法获取当前时间日期,但是MySQL里面可以分日期类型 阅读全文
posted @ 2011-03-16 23:24 MrNobody_123456 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 就在命令一句命令搞定svcutil.exe /language:cs /out:generatedProxy.cs /config:app.config http://localhost:8000/ServiceModelSamples/service 阅读全文
posted @ 2011-03-16 23:22 MrNobody_123456 阅读(210) 评论(0) 推荐(0) 编辑
摘要: Path.GetDirectoryName(Assembly.GetCallingAssembly().GetModules()[0].FullyQualifiedName; 阅读全文
posted @ 2011-03-16 23:18 MrNobody_123456 阅读(247) 评论(0) 推荐(0) 编辑
摘要: usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingMicrosoft.WindowsCE.Forms;namespaceRFIDOperator{internalclassMessageWindowForm:MessageWindow{protectedoverridevoidWndProc(refMessagemessage){switch(message.Msg){//dosomething}}}} 阅读全文
posted @ 2011-03-16 23:18 MrNobody_123456 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 32feet.NET是shared-source的项目,支持CF.net 2.0以及桌面版本.NET framework,提供短距离领域(personal area networking technologie)的通信功能,支持bluetooth,Infrared(IrDA)红外等,在这篇文章,主要介绍bluetooth部分的开发。32feet.NET 项目主页http://inthehand.com/content/32feet.aspx32feet.NET 安装包及例子http://32feet.codeplex.com/Release/ProjectReleases.aspx?Relea 阅读全文
posted @ 2011-03-16 23:17 MrNobody_123456 阅读(620) 评论(0) 推荐(0) 编辑
摘要: View Code //.NETCF:[DllImport("coredll.Dll")]privatestaticexternintGetLastError();[DllImport("coredll.Dll")]privatestaticexternintReleaseMutex(IntPtrhMutex);[DllImport("coredll.Dll")]privatestaticexternIntPtrCreateMutex(SECURITY_ATTRIBUTESlpMutexAttributes,boolbInitialO 阅读全文
posted @ 2011-03-16 23:15 MrNobody_123456 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 以前在绑定数据时,偶尔会出现“值不在范围内”的异常,看了很久的代码没找出来什么原因今天在加功能的时候的又出现这个异常,调试了大半天,终于发现问题所在,原来是绑定DisplayMember、ValueMember全写成大写了,跟数据库的字段大小写不一致,尽量绑定数据库时跟数据库字段的大小写保持一致,就不会出现这类型很难发现的异常了;记录下以后可以查找资料 阅读全文
posted @ 2011-03-16 23:13 MrNobody_123456 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 在做WPF的Demo时,碰到这样的问题,现在将它记录下来,以供需要时查阅。在Demo中用到Image控件绑定数据时,走正常绑定流程没出现什么问题,但在程序中用代码去设置这个Image的Source时会自动取消绑定,下次走正常绑定流程会失效 如下图代码:View Code if(string.IsNullOrEmpty(sourceFileName)==false){txtPluginIcoPath.Text=sourceFileName;BitmapImagetempImage=newBitmapImage();tempImage.BeginInit();tempImage.StreamSou 阅读全文
posted @ 2011-03-16 23:08 MrNobody_123456 阅读(601) 评论(0) 推荐(0) 编辑
摘要: 转载:http://hi.baidu.com/meteortent/blog/item/e42144f6e18f7f2f720eec8b.htmlOne of the new features in 3.5 SP1 is stringformat. The usage is pretty simple. So following are simple snippets showing its useView Code <TextBoxText="{BindingPath=Double,StringFormat=F3}"/><TextBoxText=&quo 阅读全文
posted @ 2011-03-16 23:06 MrNobody_123456 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 从http://zh-cn.w3support.net/index.php?db=so&id=651416找到VB的超链接响应,于是就改成了C#的前台绑定代码View Code <my:DataGridHyperlinkColumn.ElementStyle><StyleTargetType="TextBlock"><EventSetterEvent="Hyperlink.Click"Handler="OnHyperlinkClick"/></Style></my:Data 阅读全文
posted @ 2011-03-16 23:01 MrNobody_123456 阅读(600) 评论(0) 推荐(1) 编辑
摘要: 看电影或者网络电视的时候很好哦,比如你想看着电视睡觉,但是你又懒得去关电脑,就可以设置定时关机,呵呵。虽然现在很多小软件都能实现这个功能,但如果你不想因此安装多余的软件或者怕怕这些小软件带来病毒的话,那就只好自己动手了。我们有必要先了解一下WINDOWS XP的关机。Windows XP系统通过一个名为Shutdown.exe的程序来完成关机操作(位置在Windows\System下),一般情况下XP的关机是由关机程序shutdown.exe来实现的,关机的时候调用shutdown.exe。既然谈到shutdown.exe,有必要将其它重要参数介绍一下: shutdown.exe -a 取消关 阅读全文
posted @ 2011-03-16 22:51 MrNobody_123456 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 操作系统中的dll文件被程序调用无法直接删除,只能通过特殊方式进行删除,步骤如下: 1、在运行里输入cmd进入命令提示符。 2、输入命令tasklist /m > 123.txt 查看dll文件是哪个程序在调用,结束该程序或进程,然后删除dll文件。 3、如果查出来的占用dll文件的进程是svhost.exe进程,这个进程一般系统有7、8个之多,则可以根据PID进程号来结束进程,然后删除dll文件。查看PID进程号可以用命令:tasklist /svc 阅读全文
posted @ 2011-03-16 22:50 MrNobody_123456 阅读(781) 评论(0) 推荐(0) 编辑
摘要: 你是不是装过VMware,我先装VS2005,后装VMware。然后进服务把VMware的一些随开机启动的服务改成手动了。就出现启动画面停在那,无响应的事情发生了。VMDebugger导致VS2005无法启动,就出现了VS2005启动时只显示到启动界面就定住的情况。发现了原因是VMware装上后在VS2005上添加了一个VMDebugger工具栏,VMware服务没有加载,就导致了VS2005无法启动。然后在工具->外接程序管理器中把启动选项去掉,但是下次启动VS2005依然加载VMDebugger,有点流氓了哈….终于Google到一个老外的Blog上看到解决方法:在注册表的HKEY_ 阅读全文
posted @ 2011-03-16 22:49 MrNobody_123456 阅读(213) 评论(0) 推荐(0) 编辑
摘要: View Code //正常换行GridView1.Attributes.Add("style","word-break:keep-all;word-wrap:normal");//下面这行是自动换行GridView1.Attributes.Add("style","word-break:break-all;word-wrap:break-word");div中,文本布局经常出现,换行混乱的情况。问题表现:1.如果是全英文字符串,中间不包含任何符号(包括空格),不自动换行. 2.中英文混写,则在英文字符串的开始处换 阅读全文
posted @ 2011-03-16 22:45 MrNobody_123456 阅读(641) 评论(0) 推荐(0) 编辑
摘要: ///<summary>///合并单元格///</summary>///<paramname="gv">需要合并的风格视图</param>///<paramname="rowCount">需要合并的列</param>privatevoidGroupGridView(GridViewgv,introwCount){stringstr="";inti=0;inta1=0;introwSpanCount=2;foreach(GridViewRowrowingv.Rows 阅读全文
posted @ 2011-03-16 22:42 MrNobody_123456 阅读(213) 评论(0) 推荐(0) 编辑
摘要: //TransmitFile实现下载protectedvoidButton1_Click1(objectsender,EventArgse){/*微软为Response对象提供了一个新的方法TransmitFile来解决使用Response.BinaryWrite下载超过400mb的文件时导致Aspnet_wp.exe进程回收而无法成功下载的问题。代码如下:*/stringstrFileName="三部闲置设备管理系统操作手册IEMS.ppt";Response.ContentType="application/x-zip-compressed";//R 阅读全文
posted @ 2011-03-16 22:40 MrNobody_123456 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 微软官方网站的介绍:http://msdn.microsoft.com/zh-cn/library/ms972974.aspx 阅读全文
posted @ 2011-03-16 22:36 MrNobody_123456 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 在asp.net中,aspx页面中的form表单一般是提交到本页面,如果要将form表单提交到另一页面需要将要提交的form设置成如下格式:<form id="form1" runat="server" method="post" onsubmit="this.action='Answer.aspx'" > <asp:Button ID="Button1" runat="server" Text="Button" /> 阅读全文
posted @ 2011-03-16 22:34 MrNobody_123456 阅读(418) 评论(0) 推荐(0) 编辑
摘要: 使用 jdk 自带的 native2ascii.exe 工具,在你的 jdk文件夹/bin 下能找到。 针对你的问题,在 cmd 窗口中执行下面的命令即可(需要将 jdk文件夹/bin 加入到 path 环境变量中): native2ascii -reverse C:\abc.java c:\abc2.java (这里abc.java表示你的含有 \uxxxx 字符的java文件; c:\... 阅读全文
posted @ 2009-02-16 22:05 MrNobody_123456 阅读(1279) 评论(0) 推荐(0) 编辑
摘要: 如何呼出控制台 --输入:" ; console 1.0 然后回车就可以出来了 超级跳 打开控制台输入下面三句: alias +sjump "+jump;+duck" alias -sjump "-jump;-duck" bind space +sjump 如何添加机器人bot? 答:调出控制台输入相关命令,以下是部分命令: 1、智能: bot_difficulty 0-简... 阅读全文
posted @ 2009-02-16 22:04 MrNobody_123456 阅读(460) 评论(0) 推荐(0) 编辑