Merge branch 'master' of http://www.scserverddns.top:13000/sc/SunlightCentralizedControlManagement
This commit is contained in:
commit
0a80ae9db4
3 files changed
+55
-9
No files matched your search
@@ -169,10 +169,10 @@
|
||||
</ListViewItem>
|
||||
</ListView>
|
||||
<ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled" Foreground="#FF1368BD">
|
||||
<ListViewItem Width="150" MouseLeftButtonUp="ListViewItem_Conveyor">
|
||||
<ListViewItem Width="150" MouseLeftButtonUp="ListViewItem_Screen">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="Pipe" Width="40" Height="30" Margin="10" VerticalAlignment="Center" Foreground="#FF1368BD"/>
|
||||
<TextBlock Text="{x:Static lang:Resources.Conveyor}" VerticalAlignment="Center" Margin="20 10" Foreground="White"/>
|
||||
<materialDesign:PackIcon Kind="Monitor" Width="40" Height="30" Margin="10" VerticalAlignment="Center" Foreground="#FF1368BD"/>
|
||||
<TextBlock Text="{x:Static lang:Resources.Screen}" VerticalAlignment="Center" Margin="20 10" Foreground="White"/>
|
||||
</StackPanel>
|
||||
</ListViewItem>
|
||||
</ListView>
|
||||
|
||||
@@ -21,12 +21,15 @@ using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Threading;
|
||||
using VncSharpWpf;
|
||||
using System.Xml.Linq;
|
||||
using TouchSocket.Core;
|
||||
using TouchSocket.Sockets;
|
||||
using static SunlightCentralizedControlManagement_SCCM_.WindowsView.ViewStep;
|
||||
using static System.Net.WebRequestMethods;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Rebar;
|
||||
using SunlightCentralizedControlManagement_SCCM_.UserClass;
|
||||
using System.Net.NetworkInformation;
|
||||
|
||||
namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
{
|
||||
@@ -91,12 +94,59 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
log.Visibility = Visibility.Visible;
|
||||
Picture.Visibility = Visibility.Collapsed;
|
||||
}//信息
|
||||
private void ListViewItem_Conveyor(object sender, MouseButtonEventArgs e)
|
||||
|
||||
private async Task<bool> PingTest(string ip)
|
||||
{
|
||||
bool result = false;
|
||||
Ping pingSender = new Ping();
|
||||
|
||||
try
|
||||
{
|
||||
PingReply reply = await pingSender.SendPingAsync(ip, 3000);
|
||||
|
||||
if (reply.Status == IPStatus.Success)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
catch (PingException)
|
||||
{
|
||||
result = false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
private async void ListViewItem_Screen(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
machines_info = 1;
|
||||
log.Visibility = Visibility.Visible;
|
||||
Picture.Visibility = Visibility.Collapsed;
|
||||
}//输送
|
||||
|
||||
RemoteDesktopWpf remoteDesktopWpf = new RemoteDesktopWpf();
|
||||
Picture.Content = remoteDesktopWpf;
|
||||
|
||||
|
||||
DataRow drEmployee = MainWindowViewModel.Machines.Select("NAME='" + machine + "'").First();
|
||||
string host = drEmployee.Field<string>("IP");
|
||||
int port = Convert.ToInt16(drEmployee.Field<int>("PORT"));
|
||||
string password = drEmployee.Field<string>("SYSKEY");
|
||||
|
||||
if (await PingTest(host))
|
||||
{
|
||||
if (!remoteDesktopWpf.IsConnected)
|
||||
{
|
||||
try
|
||||
{
|
||||
remoteDesktopWpf.VncPort = port;
|
||||
remoteDesktopWpf.Passwd = password;
|
||||
remoteDesktopWpf.Connect(host, true, false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogGing.ERRDATA(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}//远程
|
||||
private void ListViewItem_Receipt(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
machines_info = 2;
|
||||
|
||||
Reference in new issue
Block a user