C # Create Socket service

Source: Internet
Author: User

1. Create a new Windows service, name (Websendmsgsocket, check Properties-version number) Double-click Service1.cs Open Design view, right-click in Design view, choose Add Installer Installing the ServiceProcessInstaller1 and ServiceInstaller1 components

2. Change the ServiceProcessInstaller1 account to LocalSystem and change the servicename of ServiceInstaller1 to the desired service name (WEBSENDMSG)

3. Rename the Service1.cs and start writing the code

4. Regenerate and get a WebSendMsgSocket.exe program in the folder Bin-debug directory that corresponds to the project, then install the program to the service and run it in the service

5. The administrator runs Windows-system32-cmd.exe CD C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 (note that the version number matches the project version number)

Directory paths for 6.installutil/u project WebSendMsgSocket.exe programs such as C:\just\bin\Debug\WebSendMsgSocket.exe

7.net start websendmsg (service name)

C # Create Socket service

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.