|
@ -25,7 +25,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.EX |
|
|
{ |
|
|
{ |
|
|
string host = "127.0.0.1"; // 替换为你的 VNC 服务器地址
|
|
|
string host = "127.0.0.1"; // 替换为你的 VNC 服务器地址
|
|
|
int port = 5901; // 替换为你的 VNC 服务器端口
|
|
|
int port = 5901; // 替换为你的 VNC 服务器端口
|
|
|
string password = " "; // 替换为你的 VNC 服务器密码
|
|
|
string password = "123456"; // 替换为你的 VNC 服务器密码
|
|
|
|
|
|
|
|
|
public VNC() |
|
|
public VNC() |
|
|
{ |
|
|
{ |
|
@ -70,7 +70,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.EX |
|
|
public void Parameter(object IP,object PROT,object USER ,object PASSWD) |
|
|
public void Parameter(object IP,object PROT,object USER ,object PASSWD) |
|
|
{// host = IP.ToString();
|
|
|
{// host = IP.ToString();
|
|
|
//port =Convert.ToInt16( PROT);
|
|
|
//port =Convert.ToInt16( PROT);
|
|
|
password = PASSWD.ToString(); } |
|
|
// password = PASSWD.ToString();
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/* private Window_Loaded(object sender, RoutedEventArgs e) |
|
|
/* private Window_Loaded(object sender, RoutedEventArgs e) |
|
|
{ |
|
|
{ |
|
@ -85,7 +86,9 @@ namespace SunlightCentralizedControlManagement_SCCM_.EX |
|
|
if (!vnc.IsConnected) |
|
|
if (!vnc.IsConnected) |
|
|
{ |
|
|
{ |
|
|
vnc.VncPort = port; |
|
|
vnc.VncPort = port; |
|
|
vnc.Connect(host, false, true); |
|
|
vnc.GetPassword(); |
|
|
|
|
|
vnc.Connect(host, true, true); |
|
|
|
|
|
// vnc.Authenticate(password);
|
|
|
|
|
|
|
|
|
//System.Windows.MessageBox.Show("VNC 连接成功!");
|
|
|
//System.Windows.MessageBox.Show("VNC 连接成功!");
|
|
|
} |
|
|
} |
|
|