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

¡¾×ª¡¿C#´´½¨ÍøÕ¾·½·¨£¨Ò»£©

1¡¢ÒýÓõĿռ䣺
using System.DirectoryServices;
using System.ServiceProcess;
2¡¢µ÷ÓÃ
private void button1_Click(object sender, EventArgs e)
{
String webSiteName = "ĬÈÏÍøÕ¾";
String pathToRoot = @"C:\Inetpub\wwwroot";
CreateWebSite(webSiteName,"80", pathToRoot);
}
3¡¢·½·¨
private void CreateWebSite(string webSiteName, string webSitePort, string pathToRoot)
{
//Õ¾µãÃû³ÆºÍÎïÀí·¾¶
DirectoryEntry root = new DirectoryEntry("IIS://localhost/W3SVC");// Find unused ID value for new web site
int siteID = 1;
//µÃµ½ÏÖÓеÄÕ¾µã±êʶ
foreach (DirectoryEntry entry in root.Children)
{
if (entry.SchemaClassName == "IIsWebServer")
{
int ID = Convert.ToInt32(entry.Name);
if (ID >= siteID)
{
siteID = ID + 1;
}
}
}
//ÀûÓÃÅäÖÃÎļþµÄ×ö·¨´´½¨Õ¾µã£¬ÐèÒªÏÈÍ£Ö¹Ô­À´µÄ·þÎñ£¬ÒÔ±ãÄܹ»Ë³ÀûдÈëÊý¾Ý
label1.Text = "ÕýÔÚÍ£Ö¹·þÎñ……";
Application.DoEvents();
System.ServiceProcess.ServiceController mobServiceController3 = new System.ServiceProcess.ServiceController("IISAdmin");
foreach (System.ServiceProcess.ServiceController dependentService in mobServiceController3.DependentServices)
{
switch (dependentService.Status)
{
case ServiceControllerStatus.Stopped:
break;
case ServiceControllerStatus.StopPending:
dependentService.WaitForStatus(ServiceControllerStatus.Stopped);
break;
default:
dependentService.Stop();
dependentService.WaitForStatus(ServiceController


Ïà¹ØÎĵµ£º

C# »Ø¹ö1

c#ÊÂÎñ»Ø¹ö£¨×ª£©
×÷Õߣºxue5ya  À´Ô´£º²©¿ÍÔ°  ·¢²¼Ê±¼ä£º2009-03-20 16:08  ÔĶÁ£º263 ´Î  Ô­ÎÄÁ´½Ó   [ÊÕ²Ø]  
Code
public void UpdateContactTableByDataSet(DataSet ds,string strTblName) 

    ......

C#»ùÓÚTCPµÄSocketͨÐÅ


   
TCPЭÒéÊÇÒ»¸ö»ù±¾µÄÍøÂçЭÒ飬»ù±¾ÉÏËùÓеÄÍøÂç·þÎñ¶¼ÊÇ»ùÓÚTCPЭÒéµÄ£¬ÈçHTTP£¬FTPµÈµÈ£¬ËùÒÔÒªÁ˽âÍøÂç±à³Ì¾Í±ØÐëÁ˽â»ùÓÚTCPЭÒéµÄ±à
³Ì¡£È»¶øTCPЭÒéÊÇÒ»¸öÅÓÔÓµÄÌåϵ£¬Òª³¹µ×µÄŪÇå³þËüµÄʵÏÖ²»ÊÇÒ»ÌìÁ½ÌìµÄ¹¦·ò£¬ËùÐÒµÄÊÇÔÚ¡£net
framework»·¾³Ï£¬ÎÒÃDz»±ØÒªÈ¥×·¾¿TCPЭÒéµ×²ãµÄʵÏÖ£¬Ò»Ñù ......

ÓÃC#Éú³ÉWAPÒ³Ãæ½éÉÜ

ÊÖ»úÉÏÍøÔ½À´Ô½ÆÕ¼°£¬ÊÖ»úÖÖÀàÔ½À´Ô½¶à£¬Òª¿ª·¢Ò»¸ö¹©ÊÖ»ú·ÃÎÊÍøÕ¾²¢¼æÈÝËùÓв»Í¬ÀàÐ͵ÄÊÖ»úºÍä¯ÀÀÆ÷ÊǺܲ»ÈÝÒ׵쬱±¾©Ê¦·¶´óѧ×ÔϰÊÒ²éѯƽ̨µÄÊÖ»ú°æ×î³õÊÇÖ±½ÓÓÃASP.NETʵÏֵģ¬Ö»ÊÇÓÃCSS¶¨Òå³ÉÁËÊʺÏÊÖ»úÆÁÄ»µÄÒ³Ãæ£¬ËäȻͬѧÃÇ·ÃÎÊ»ù±¾Ã»ÓÐÎÊÌ⣬µ«ÊÇҲż¶û»áÓГ²»ÄÜÑ¡ÔñÏÂÀ­²Ëµ¥”¡¢“°´Å¥button²»Ä ......

sql c#

C-#ÈëÞ­µä(µÚÈý°æ).pdf
using System;
using System.Data;
using System.Data.SqlClient;
namespace My_Student
{
    static class Program
    {
       
        static void Main()
  &n ......

C#ÀûÓÃwebrequest¼ÆËã´ýÏÂÔØµÄÎļþ´óС

C#ÀûÓÃwebrequest¼ÆËã´ýÏÂÔØµÄÎļþ´óС
string URL = textBox1.Text;
string filetype = URL.Substring(URL.LastIndexOf(".") + 1, (URL.Length - URL.LastIndexOf(".") - 1));
filetypevalue.Text = filetype.ToUpper();
string filename = URL.Substring(URL.LastIn ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ