📄 service1.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.ServiceProcess;
using System.Text;
namespace chatserver
{
public partial class Service1 : ServiceBase
{
public Service1()
{
InitializeComponent();
this.ServiceName = "Chat ip";
this.EventLog.Source = "Chat ip";
this.EventLog.Log = "Application";
this.CanStop = false;
this.CanPauseAndContinue = true;
}
protected override void OnStart(string[] args)
{
String hostPort = "";
Form2 chat = new Form2(hostPort);
chat.Show();
}
protected override void OnStop()
{
String hostPort = "";
Form2 blockedForm = new Form2(hostPort);
blockedForm.Show();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -