Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

C# °²×°²¼Êð ¼°Windows·þÎñ×Ô¶¯Æô¶¯

ÉèÖÃserviceProcessInstaller1¿Ø¼þµÄAccountÊôÐÔΪ“LocalSystem”
ÉèÖÃserviceInstaller1¿Ø¼þµÄStartTypeÊôÐÔΪ"Automatic"
ÔÚ·þÎñÆ÷ÉÏÌí¼Ó°²×°³ÌÐò£¬ÔÚprivate void ProjectInstaller_AfterInstall(object sender, InstallEventArgs e)ʼþÖУ¬Ìí¼ÓÒÔÏ´úÂ룺
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
string Cmdstring = "sc start myservice"; //CMDÃüÁî
p.StandardInput.WriteLine(Cmdstring);
p.StandardInput.WriteLine("exit");
¼´¿ÉÔÚ°²×°·þÎñºóÁ¢¿ÌÆô¶¯windows·þÎñ
 
 
×¢£º ÒýÓÃusing System.Diagnostics;//µ÷ÓÃProcess
 
C#°²×°²¼Êð
½¨Á¢Ò»¸öÐµİ²×°ÏîÄ¿ServerSetup£¨Îª¸Õ²ÅÄǸö·þÎñ½¨Á¢Ò»¸ö°²×°ÏîÄ¿£© 
ÓÒ¼ü£­Ìí¼Ó£­ÏîÄ¿Êä³ö£­Ö÷Êä³ö£­Ñ¡ÔñService1£­È·¶¨ 
ÓÒ¼ü£­ÊÓͼ£­×Ô¶¨Òå²Ù×÷£­×Ô¶¨Òå²Ù×÷ÉÏÓÒ¼ü£­Ìí¼Ó×Ô¶¨Òå²Ù×÷£­´ò¿ªÓ¦ÓóÌÐòÎļþ¼Ð£­Ñ¡Ôñ¸Õ²ÅÄǸöÖ÷Êä³ö£­È·¶¨ 
ÖØÐÂÉú³ÉÕâ¸ö°²×°ÏîÄ¿£­ÓÒ¼ü£­°²×° 
 
 
²é¿´·þÎñ,,Ôò×ÔÒѵķþÎñ("myservice")ÒÑ×Ô¶¯Æô¶¯


Ïà¹ØÎĵµ£º

[Õª×Ôc#Bible]c#ÖÐnamespaceµÄʹÓã¨ÃüÃû¿Õ¼ä£©

The C# classes that you design will be used by code that you write and possibly by code that
other people write. Your C# classes may be used by a VB.NET application or from within an
ASP.NET page. Moreover, your classes may very well be used alongside other classes
designed by other .NET develope ......

java Óë c# ¶Ô±È ˼¿¼

´ÓʱàÂë7Äê¶àÁË
¶ÔÓÚjava ºÍc# ÎÒÓÐ×Å×Ô¼ºµÄÀí½â
ÔÚ2009ÄêµÄ9ÔÂÕâ¸öʱ¼äµãÎÒ¿´À´java  c#ÊÇÐÂʽÓïÑԵĴú±í
{ÒòΪÎÒÈÏΪ¼ÆËã»úµÄ·¢Õ¹Àú³ÌÊÇ
µÚÒ»½×¶Î ´ò¿×»ú(¶þ½øÖÆ),
µÚ2½×¶Î »ã±à, (±È¶þ½øÖÆ·½±ãµÄÓïÑÔ),
µÚ3½×¶Î c (¸üÒ×ÓÚ¿´Ã÷°×µÄ¸ß¼¶ÓïÑÔ),
µÚ4½×¶ÎµÚ1²ã c++ (´Ó¶ÔÏó½Ç¶ÈÀí½âµÄ¸ß¼¶ÓïÑÔ),
µÚ4½×¶ÎµÚ2² ......

C#·¢ËÍÓʼþ´úÂë £¨B/S¡¢C/S½Ô¿ÉÓã©

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using  ......

VB/C++/C#´®¿ÚͨѶԴ´úÂ롾¸½ÏêϸעÊÍ¡¿


VB
    If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
    MSComm1.CommPort = i1
    MSComm1.PortOpen = True
    MSComm1.InputMode = comInputModeBinary
    MSComm1.InBufferCount = 0
& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ