You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
1.7 KiB

7 months ago
using SunlightCentralizedControlManagement_SCCM_.View;
using SunlightCentralizedControlManagement_SCCM_.EX;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
7 months ago
using System.Net.NetworkInformation;
7 months ago
7 months ago
namespace SunlightCentralizedControlManagement_SCCM_.EX
7 months ago
{
/// <summary>
/// UserMessage.xaml 的交互逻辑
/// </summary>
public partial class VNC : Window
{
7 months ago
string host = "172.0.0.1"; // 替换为你的 VNC 服务器地址
int port = 5901; // 替换为你的 VNC 服务器端口
string password = " "; // 替换为你的 VNC 服务器密码
7 months ago
public VNC()
{
InitializeComponent();
7 months ago
if (!vnc.IsConnected)
{
vnc.Connect(host, false, true);
//System.Windows.MessageBox.Show("VNC 连接成功!");
}
7 months ago
}
private void Save_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
7 months ago
private bool PingTest(string ip)
{
bool result = false;
Ping pingSender = new Ping();
try
{
PingReply reply = pingSender.Send(ip, 120);
if (reply.Status == IPStatus.Success)
{
result = true;
}
}
catch (PingException e)
{
result = false;
}
return result;
}
7 months ago
}
7 months ago
7 months ago
}