1
0
mirror of https://e.coding.net/circlecloud/SixiBroadcast.git synced 2025-11-24 23:56:05 +00:00

客户端添加开机自动启 服务端添加指令系统...

This commit is contained in:
j502647092
2015-08-07 14:42:39 +08:00
parent e3a249fe54
commit 11bc60af26
2 changed files with 35 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using Microsoft.Win32;
using UDPClient.Properties;
namespace UDPClient
@@ -30,6 +31,12 @@ namespace UDPClient
private void Frm_Client_Load(object sender, EventArgs e)
{
//开机自启动添加
string path = Application.ExecutablePath;
RegistryKey rk = Registry.LocalMachine.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run");
rk.SetValue("SixiBroadcast", path);
rk.Close();
//初始化数据
client = new UdpClient(new IPEndPoint(IPAddress.Any, 25333));
serverendpoint = new IPEndPoint(IPAddress.Loopback, 25433);
//启动客户端监听