mirror of
https://github.com/proxysu/ProxySU.git
synced 2025-04-02 21:36:17 +03:00
尝试测验与校对远程主机与本地的时间
This commit is contained in:
parent
de56f40824
commit
ca7132c244
6 changed files with 319 additions and 125 deletions
|
@ -7,122 +7,149 @@
|
|||
mc:Ignorable="d"
|
||||
Title="ProxySU" Height="550" Width="600">
|
||||
<Grid>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="80"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition Width="80"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="40"></RowDefinition>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="30" ></RowDefinition>
|
||||
<RowDefinition ></RowDefinition>
|
||||
<RowDefinition ></RowDefinition>
|
||||
<RowDefinition Height="60"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="主机名" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="0" Grid.Row="0"></TextBlock>
|
||||
<TextBlock Text="端口" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="2" Grid.Row="0"></TextBlock>
|
||||
<TextBox x:Name="TextBoxHost" Text="" Margin="5" Grid.Column="1" Grid.Row="0"></TextBox>
|
||||
<TextBox x:Name="TextBoxPort" CommandManager.PreviewExecuted="TextBoxPort_PreviewExecuted" Text="22" Margin="5" Grid.Column="3" Grid.Row="0" PreviewTextInput="TextBoxPort_PreviewTextInput"/>
|
||||
<TextBlock Text="用户名:" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="0" Grid.Row="1"></TextBlock>
|
||||
<TextBlock x:Name="TextBlockPassword" Text="密码:" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="2" Grid.Row="1"></TextBlock>
|
||||
<TextBox x:Name="TextBoxUserName" Text="root" Margin="5" Grid.Column="1" Grid.Row="1"></TextBox>
|
||||
<PasswordBox x:Name="PasswordBoxHostPassword" Password="" Margin="5" Grid.Column="3" Grid.Row="1"></PasswordBox>
|
||||
<RadioButton x:Name="RadioButtonPasswordLogin" GroupName="CertIsYesNo" Content="密码登录" Grid.Column="0" Grid.Row="2" Checked="RadioButtonPasswordLogin_Checked"></RadioButton>
|
||||
<RadioButton x:Name="RadioButtonCertLogin" GroupName="CertIsYesNo" Content="密钥登录" Grid.Column="1" Grid.Row="2" Checked="RadioButtonCertLogin_Checked"></RadioButton>
|
||||
<Button x:Name="ButtonOpenFileDialog" Content="浏览..." Margin="8" Grid.Column="2" Grid.Row="2" Click="ButtonOpenFileDialog_Click"></Button>
|
||||
<TextBox x:Name="TextBoxCertFilePath" Text="" Margin="10" Grid.Column="3" Grid.Row="2"></TextBox>
|
||||
<!--代理设置-->
|
||||
<Grid Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<RadioButton x:Name="RadioButtonNoProxy" GroupName="ProxyIsYesNo" Content="无代理" Grid.Column="0" Grid.Row="0" Checked="RadioButtonNoProxy_Checked" Unchecked="RadioButtonNoProxy_Unchecked"/>
|
||||
<RadioButton x:Name="RadioButtonHttp" GroupName="ProxyIsYesNo" Content="Http代理" Grid.Column="1" Grid.Row="0"/>
|
||||
|
||||
<RadioButton x:Name="RadioButtonSocks5" GroupName="ProxyIsYesNo" Content="Socks5代理" Grid.Column="2" Grid.Row="0"/>
|
||||
<RadioButton x:Name="RadioButtonSocks4" GroupName="ProxyIsYesNo" Content="Socks4代理" Grid.Column="3" Grid.Row="0" />
|
||||
</Grid>
|
||||
|
||||
<TextBlock x:Name="TextBlockProxyHost" IsEnabled="False" Text="代理地址" HorizontalAlignment="Left" Margin="5,10,0,5" Grid.Column="0" Grid.Row="4"/>
|
||||
<TextBlock x:Name="TextBlockProxyPort" IsEnabled="False" Text="端口" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="2" Grid.Row="4"></TextBlock>
|
||||
<TextBox x:Name="TextBoxProxyHost" IsEnabled="False" Text="127.0.0.1" Margin="5" Grid.Column="1" Grid.Row="4"></TextBox>
|
||||
<TextBox x:Name="TextBoxProxyPort" IsEnabled="False" CommandManager.PreviewExecuted="TextBoxPort_PreviewExecuted" Text="1080" Margin="5" Grid.Column="3" Grid.Row="4" PreviewTextInput="TextBoxPort_PreviewTextInput"/>
|
||||
<!--代理用户名密码设置-->
|
||||
<RadioButton x:Name="RadioButtonProxyNoLogin" Content="不需登录" GroupName="proxyYesNOLogin" Grid.Column="0" Grid.Row="5" Checked="RadioButtonProxyNoLogin_Checked"></RadioButton>
|
||||
<RadioButton x:Name="RadiobuttonProxyYesLogin" Content="需要登录" GroupName="proxyYesNOLogin" Grid.Column="1" Grid.Row="5" Checked="RadiobuttonProxyYesLogin_Checked"></RadioButton>
|
||||
<TextBlock x:Name="TextBlockProxyUser" IsEnabled="False" Text="用户名:" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="0" Grid.Row="6"></TextBlock>
|
||||
<TextBlock x:Name="TextBlockProxyPassword" IsEnabled="False" Text="密码:" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="2" Grid.Row="6"></TextBlock>
|
||||
<TextBox x:Name="TextBoxProxyUserName" IsEnabled="False" Text="" Margin="5" Grid.Column="1" Grid.Row="6"></TextBox>
|
||||
<PasswordBox x:Name="PasswordBoxProxyPassword" IsEnabled="False" Password="" Margin="5" Grid.Column="3" Grid.Row="6"></PasswordBox>
|
||||
|
||||
<!--<StatusBar x:Name="StatusBarStatusMonitoring" Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="4"></StatusBar>-->
|
||||
<TextBlock x:Name="TextBlockSetUpProcessing" Text="等待安装布署" Foreground="Blue" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="4"></TextBlock>
|
||||
<ProgressBar x:Name="ProgressBarSetUpProcessing" Minimum="0" Maximum="100" Value="0" IsIndeterminate="False" Margin="7" Grid.Column="0" Grid.Row="8" Grid.ColumnSpan="4"></ProgressBar>
|
||||
<TabControl Grid.Column="0" Grid.Row="9" Grid.ColumnSpan="4" Grid.RowSpan="2">
|
||||
<TabItem Header="V2ray配置" Width="150" Height="30">
|
||||
<Grid>
|
||||
<TabControl>
|
||||
<TabItem Header="应用布署" Width="150" Height="30">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="80"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition Width="80"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="40"></RowDefinition>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="30" ></RowDefinition>
|
||||
<RowDefinition ></RowDefinition>
|
||||
<RowDefinition ></RowDefinition>
|
||||
<RowDefinition Height="60"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="主机名" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="0" Grid.Row="0"></TextBlock>
|
||||
<TextBlock Text="端口" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="2" Grid.Row="0"></TextBlock>
|
||||
<TextBox x:Name="TextBoxHost" Text="" Margin="5" Grid.Column="1" Grid.Row="0"></TextBox>
|
||||
<TextBox x:Name="TextBoxPort" CommandManager.PreviewExecuted="TextBoxPort_PreviewExecuted" Text="22" Margin="5" Grid.Column="3" Grid.Row="0" PreviewTextInput="TextBoxPort_PreviewTextInput"/>
|
||||
<TextBlock Text="用户名:" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="0" Grid.Row="1"></TextBlock>
|
||||
<TextBlock x:Name="TextBlockPassword" Text="密码:" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="2" Grid.Row="1"></TextBlock>
|
||||
<TextBox x:Name="TextBoxUserName" Text="root" Margin="5" Grid.Column="1" Grid.Row="1"></TextBox>
|
||||
<PasswordBox x:Name="PasswordBoxHostPassword" Password="" Margin="5" Grid.Column="3" Grid.Row="1"></PasswordBox>
|
||||
<RadioButton x:Name="RadioButtonPasswordLogin" GroupName="CertIsYesNo" Content="密码登录" Grid.Column="0" Grid.Row="2" Checked="RadioButtonPasswordLogin_Checked"></RadioButton>
|
||||
<RadioButton x:Name="RadioButtonCertLogin" GroupName="CertIsYesNo" Content="密钥登录" Grid.Column="1" Grid.Row="2" Checked="RadioButtonCertLogin_Checked"></RadioButton>
|
||||
<Button x:Name="ButtonOpenFileDialog" Content="浏览..." Margin="8" Grid.Column="2" Grid.Row="2" Click="ButtonOpenFileDialog_Click"></Button>
|
||||
<TextBox x:Name="TextBoxCertFilePath" Text="" Margin="10" Grid.Column="3" Grid.Row="2"></TextBox>
|
||||
<!--代理设置-->
|
||||
<Grid Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Button x:Name="ButtonGuideConfiguration" Visibility="Visible" Content="启用向导" Grid.Column="0" Grid.Row="0" Click="ButtonGuideConfiguration_Click"></Button>
|
||||
<TextBlock Text="通过向导生成配置文件" Visibility="Visible" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Center"></TextBlock>
|
||||
<Button x:Name="ButtonTemplateConfiguration" Content="打开模板库" Grid.Column="1" Grid.Row="0" Click="ButtonTemplateConfiguration_Click"></Button>
|
||||
<TextBlock Text="模板库" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Center"></TextBlock>
|
||||
<Button x:Name="ButtonAdvancedConfiguration" Visibility="Visible" Content="配置编辑器" Grid.Column="2" Grid.Row="0" Click="ButtonAdvancedConfiguration_Click"></Button>
|
||||
<TextBlock Text="配置文件高级生成器
(有经验用户可以使用)" Visibility="Visible" Grid.Column="2" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Center"></TextBlock>
|
||||
<!--<RadioButton x:Name="RadioButtonGuideConfiguration" Content="向导生成配置" Grid.Column="0" Grid.Row="0"></RadioButton>
|
||||
<RadioButton x:Name="RadioButtonNoProxy" GroupName="ProxyIsYesNo" Content="无代理" Grid.Column="0" Grid.Row="0" Checked="RadioButtonNoProxy_Checked" Unchecked="RadioButtonNoProxy_Unchecked"/>
|
||||
<RadioButton x:Name="RadioButtonHttp" GroupName="ProxyIsYesNo" Content="Http代理" Grid.Column="1" Grid.Row="0"/>
|
||||
|
||||
<RadioButton x:Name="RadioButtonSocks5" GroupName="ProxyIsYesNo" Content="Socks5代理" Grid.Column="2" Grid.Row="0"/>
|
||||
<RadioButton x:Name="RadioButtonSocks4" GroupName="ProxyIsYesNo" Content="Socks4代理" Grid.Column="3" Grid.Row="0" />
|
||||
</Grid>
|
||||
|
||||
<TextBlock x:Name="TextBlockProxyHost" IsEnabled="False" Text="代理地址" HorizontalAlignment="Left" Margin="5,10,0,5" Grid.Column="0" Grid.Row="4"/>
|
||||
<TextBlock x:Name="TextBlockProxyPort" IsEnabled="False" Text="端口" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="2" Grid.Row="4"></TextBlock>
|
||||
<TextBox x:Name="TextBoxProxyHost" IsEnabled="False" Text="127.0.0.1" Margin="5" Grid.Column="1" Grid.Row="4"></TextBox>
|
||||
<TextBox x:Name="TextBoxProxyPort" IsEnabled="False" CommandManager.PreviewExecuted="TextBoxPort_PreviewExecuted" Text="1080" Margin="5" Grid.Column="3" Grid.Row="4" PreviewTextInput="TextBoxPort_PreviewTextInput"/>
|
||||
<!--代理用户名密码设置-->
|
||||
<RadioButton x:Name="RadioButtonProxyNoLogin" Content="不需登录" GroupName="proxyYesNOLogin" Grid.Column="0" Grid.Row="5" Checked="RadioButtonProxyNoLogin_Checked"></RadioButton>
|
||||
<RadioButton x:Name="RadiobuttonProxyYesLogin" Content="需要登录" GroupName="proxyYesNOLogin" Grid.Column="1" Grid.Row="5" Checked="RadiobuttonProxyYesLogin_Checked"></RadioButton>
|
||||
<TextBlock x:Name="TextBlockProxyUser" IsEnabled="False" Text="用户名:" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="0" Grid.Row="6"></TextBlock>
|
||||
<TextBlock x:Name="TextBlockProxyPassword" IsEnabled="False" Text="密码:" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" Grid.Column="2" Grid.Row="6"></TextBlock>
|
||||
<TextBox x:Name="TextBoxProxyUserName" IsEnabled="False" Text="" Margin="5" Grid.Column="1" Grid.Row="6"></TextBox>
|
||||
<PasswordBox x:Name="PasswordBoxProxyPassword" IsEnabled="False" Password="" Margin="5" Grid.Column="3" Grid.Row="6"></PasswordBox>
|
||||
|
||||
<!--<StatusBar x:Name="StatusBarStatusMonitoring" Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="4"></StatusBar>-->
|
||||
<TextBlock x:Name="TextBlockSetUpProcessing" Text="等待安装布署" Foreground="Blue" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="4"></TextBlock>
|
||||
<ProgressBar x:Name="ProgressBarSetUpProcessing" Minimum="0" Maximum="100" Value="0" IsIndeterminate="False" Margin="7" Grid.Column="0" Grid.Row="8" Grid.ColumnSpan="4"></ProgressBar>
|
||||
<TabControl Grid.Column="0" Grid.Row="9" Grid.ColumnSpan="4" Grid.RowSpan="2">
|
||||
<TabItem Header="V2ray配置" Width="150" Height="30">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Button x:Name="ButtonGuideConfiguration" Visibility="Visible" Content="启用向导" Grid.Column="0" Grid.Row="0" Click="ButtonGuideConfiguration_Click"></Button>
|
||||
<TextBlock Text="通过向导生成配置文件" Visibility="Visible" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Center"></TextBlock>
|
||||
<Button x:Name="ButtonTemplateConfiguration" Content="打开模板库" Grid.Column="1" Grid.Row="0" Click="ButtonTemplateConfiguration_Click"></Button>
|
||||
<TextBlock Text="模板库" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Center"></TextBlock>
|
||||
<Button x:Name="ButtonAdvancedConfiguration" Visibility="Visible" Content="配置编辑器" Grid.Column="2" Grid.Row="0" Click="ButtonAdvancedConfiguration_Click"></Button>
|
||||
<TextBlock Text="配置文件高级生成器
(有经验用户可以使用)" Visibility="Visible" Grid.Column="2" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Center"></TextBlock>
|
||||
<!--<RadioButton x:Name="RadioButtonGuideConfiguration" Content="向导生成配置" Grid.Column="0" Grid.Row="0"></RadioButton>
|
||||
<RadioButton x:Name="RadioButtonTemplateConfiguration" Content="模板配置" Grid.Column="0" Grid.Row="1"></RadioButton>
|
||||
<RadioButton x:Name="RadioButtonAdvancedConfiguration" Content="高级配置" Grid.Column="0" Grid.Row="2"></RadioButton>
|
||||
<TextBox x:Name="TextBoxJsonPath" Margin="10" Grid.Column="1" Grid.Row="1"></TextBox>
|
||||
<Button x:Name="ButtonSetConfiguration" Margin="6" Content="配置" Grid.Column="2" Grid.Row="2" Click="ButtonSetConfiguration_Click"></Button>-->
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="测试面板" Visibility="Visible" Width="150" Height="30">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Button Content="测试接收到的模参数" Grid.Column="0" Grid.Row="0" Margin="10" Click="Button_Click"></Button>
|
||||
<Button Content="测试结果窗口" Grid.Column="0" Grid.Row="1" Margin="10" Click="Button_Click_1"></Button>
|
||||
<Button Content="测试ssh命令" Grid.Column="1" Grid.Row="0" Margin="10" Click="Button_Click_2"></Button>
|
||||
<Button Content="测试生成v2rayN导入格式" Grid.Column="2" Grid.Row="0" Margin="10" Click="Button_Click_3"></Button>
|
||||
<Button Content="测试生成config.json文件" Grid.Column="1" Grid.Row="1" Margin="10" Click="Button_Click_4"></Button>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="系统工具" Width="150" Height="30">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Button x:Name="ButtonProofreadTime" Content="校对时间" Grid.Column="0" Grid.Row="0" Margin="2" Click="ButtonProofreadTime_Click"/>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="测试面板" Visibility="Visible" Width="150" Height="30">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="101*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="44*"/>
|
||||
<ColumnDefinition Width="145*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="145*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="145*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Button Content="测试接收到的模参数" Grid.Column="0" Grid.Row="0" Margin="10,10,10.333,10" Click="Button_Click" Grid.ColumnSpan="2"></Button>
|
||||
<Button Content="测试结果窗口" Grid.Column="0" Grid.Row="1" Margin="10,10,10.333,9.667" Click="Button_Click_1" Grid.ColumnSpan="2"></Button>
|
||||
<Button Content="测试ssh命令" Grid.Column="2" Grid.Row="0" Margin="9.667,10,9.666,10" Click="Button_Click_2"></Button>
|
||||
<Button Content="测试生成v2rayN导入格式" Grid.Column="3" Grid.Row="0" Margin="10.334,10,10,10" Click="Button_Click_3"></Button>
|
||||
<Button Content="测试生成config.json文件" Grid.Column="2" Grid.Row="1" Margin="9.667,10,9.666,9.667" Click="Button_Click_4"></Button>
|
||||
<Button Content="测试时间" Grid.Column="4" Grid.Row="0" Margin="10,10,10.333,10" Click="Button_Click_5"></Button>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
<Button x:Name="Button_Login" Content="布署安装" Grid.ColumnSpan="2" Margin="10" Grid.Column="0" Grid.Row="11" Click="Button_Login_Click"></Button>
|
||||
<Button x:Name="Button_canel" Content="取消" Grid.ColumnSpan="2" Margin="10" Grid.Column="2" Grid.Row="11" Click="Button_canel_Click"></Button>
|
||||
</Grid>
|
||||
|
||||
<Button x:Name="Button_Login" Content="布署安装" Grid.ColumnSpan="2" Margin="10" Grid.Column="0" Grid.Row="11" Click="Button_Login_Click"></Button>
|
||||
<Button x:Name="Button_canel" Content="取消" Grid.ColumnSpan="2" Margin="10" Grid.Column="2" Grid.Row="11" Click="Button_canel_Click"></Button>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="资源工具" Width="150" Height="30">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
@ -36,6 +36,7 @@ namespace ProxySU
|
|||
//ReceiveConfigurationParameters[3]----path
|
||||
//ReceiveConfigurationParameters[4]----domain
|
||||
//ReceiveConfigurationParameters[5]----mKCP伪装类型
|
||||
//public static ConnectionInfo ConnectionInfo;
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
@ -46,18 +47,17 @@ namespace ProxySU
|
|||
ReceiveConfigurationParameters = new string[6];
|
||||
|
||||
}
|
||||
//开始布署安装
|
||||
|
||||
private void Button_Login_Click(object sender, RoutedEventArgs e)
|
||||
|
||||
//远程主机连接信息
|
||||
private ConnectionInfo GenerateConnectionInfo()
|
||||
{
|
||||
ConnectionInfo connectionInfo;
|
||||
//ProgressBarSetUpProcessing.IsIndeterminate = true;
|
||||
#region 检测输入的内空是否有错,并读取内容
|
||||
if (string.IsNullOrEmpty(TextBoxHost.Text) == true || string.IsNullOrEmpty(TextBoxPort.Text) == true || string.IsNullOrEmpty(TextBoxUserName.Text) == true)
|
||||
{
|
||||
MessageBox.Show("主机地址、主机端口、用户名为必填项,不能为空");
|
||||
//exitProgram.Kill();
|
||||
return;
|
||||
return connectionInfo = null;
|
||||
}
|
||||
string sshHostName = TextBoxHost.Text.ToString();
|
||||
int sshPort = int.Parse(TextBoxPort.Text);
|
||||
|
@ -65,27 +65,27 @@ namespace ProxySU
|
|||
if (RadioButtonPasswordLogin.IsChecked == true && string.IsNullOrEmpty(PasswordBoxHostPassword.Password) == true)
|
||||
{
|
||||
MessageBox.Show("登录密码为必填项,不能为空");
|
||||
return;
|
||||
return connectionInfo = null;
|
||||
}
|
||||
string sshPassword = PasswordBoxHostPassword.Password.ToString();
|
||||
if (RadioButtonCertLogin.IsChecked == true && string.IsNullOrEmpty(TextBoxCertFilePath.Text) == true)
|
||||
{
|
||||
MessageBox.Show("密钥文件为必填项,不能为空");
|
||||
return;
|
||||
return connectionInfo = null;
|
||||
}
|
||||
string sshPrivateKey = TextBoxCertFilePath.Text.ToString();
|
||||
ProxyTypes proxyTypes = new ProxyTypes();//默认为None
|
||||
//MessageBox.Show(proxyTypes.ToString());
|
||||
//proxyTypes = ProxyTypes.Socks5;
|
||||
if (RadioButtonHttp.IsChecked==true)
|
||||
if (RadioButtonHttp.IsChecked == true)
|
||||
{
|
||||
proxyTypes = ProxyTypes.Http;
|
||||
}
|
||||
else if (RadioButtonSocks4.IsChecked==true)
|
||||
else if (RadioButtonSocks4.IsChecked == true)
|
||||
{
|
||||
proxyTypes = ProxyTypes.Socks4;
|
||||
}
|
||||
else if (RadioButtonSocks5.IsChecked==true)
|
||||
else if (RadioButtonSocks5.IsChecked == true)
|
||||
{
|
||||
proxyTypes = ProxyTypes.Socks5;
|
||||
}
|
||||
|
@ -95,17 +95,17 @@ namespace ProxySU
|
|||
}
|
||||
|
||||
//MessageBox.Show(proxyTypes.ToString());
|
||||
if (RadioButtonNoProxy.IsChecked==false&&(string.IsNullOrEmpty(TextBoxProxyHost.Text)==true||string.IsNullOrEmpty(TextBoxProxyPort.Text)==true))
|
||||
if (RadioButtonNoProxy.IsChecked == false && (string.IsNullOrEmpty(TextBoxProxyHost.Text) == true || string.IsNullOrEmpty(TextBoxProxyPort.Text) == true))
|
||||
{
|
||||
MessageBox.Show("如果选择了代理,则代理地址与端口不能为空");
|
||||
return;
|
||||
return connectionInfo = null;
|
||||
}
|
||||
string sshProxyHost = TextBoxProxyHost.Text.ToString();
|
||||
int sshProxyPort = int.Parse(TextBoxProxyPort.Text.ToString());
|
||||
if (RadiobuttonProxyYesLogin.IsChecked == true && (string.IsNullOrEmpty(TextBoxProxyUserName.Text) == true || string.IsNullOrEmpty(PasswordBoxProxyPassword.Password) == true))
|
||||
{
|
||||
MessageBox.Show("如果代理需要登录,则代理登录的用户名与密码不能为空");
|
||||
return;
|
||||
return connectionInfo = null;
|
||||
}
|
||||
string sshProxyUser = TextBoxProxyUserName.Text.ToString();
|
||||
string sshProxyPassword = PasswordBoxProxyPassword.Password.ToString();
|
||||
|
@ -115,7 +115,7 @@ namespace ProxySU
|
|||
|
||||
//var connectionInfo = new PasswordConnectionInfo(sshHostName, sshPort, sshUser, sshPassword);
|
||||
|
||||
var connectionInfo = new ConnectionInfo(
|
||||
connectionInfo = new ConnectionInfo(
|
||||
sshHostName,
|
||||
sshPort,
|
||||
sshUser,
|
||||
|
@ -144,7 +144,19 @@ namespace ProxySU
|
|||
);
|
||||
|
||||
}
|
||||
return connectionInfo;
|
||||
}
|
||||
//开始布署安装
|
||||
|
||||
private void Button_Login_Click(object sender, RoutedEventArgs e)
|
||||
|
||||
{
|
||||
ConnectionInfo connectionInfo = GenerateConnectionInfo();
|
||||
if(connectionInfo==null)
|
||||
{
|
||||
MessageBox.Show("远程主机连接信息有误,请检查");
|
||||
return;
|
||||
}
|
||||
//using (var client = new SshClient(sshHostName, sshPort, sshUser, sshPassword))
|
||||
//Action<ConnectionInfo, TextBlock> startSetUpAction = new Action<ConnectionInfo, TextBlock>(StartSetUpRemoteHost);
|
||||
//string appConfig = TextBoxJsonPath.Text.ToString().Replace("\\","\\\\");
|
||||
|
@ -443,6 +455,28 @@ namespace ProxySU
|
|||
Thread.Sleep(1000);
|
||||
return;
|
||||
}
|
||||
|
||||
//校对时间
|
||||
currentStatus = "校对时间......";
|
||||
textBlockName.Dispatcher.BeginInvoke(updateAction, textBlockName, progressBar, currentStatus);
|
||||
Thread.Sleep(1000);
|
||||
//获取远程主机的时间戳
|
||||
long timeStampVPS = Convert.ToInt64(client.RunCommand("date +%s").Result.ToString());
|
||||
//MessageBox.Show(timesStampVPS.ToString());
|
||||
//获取本地时间戳
|
||||
TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
|
||||
long timeStampLocal = Convert.ToInt64(ts.TotalSeconds);
|
||||
if (Math.Abs(timeStampLocal - timeStampVPS) >= 90)
|
||||
{
|
||||
|
||||
MessageBox.Show("本地时间与远程主机时间相差超过限制(90秒),请先用\"系统工具-->时间校对\"校对时间后再设置");
|
||||
currentStatus = "时间较对失败......";
|
||||
textBlockName.Dispatcher.BeginInvoke(updateAction, textBlockName, progressBar, currentStatus);
|
||||
Thread.Sleep(1000);
|
||||
return;
|
||||
}
|
||||
//MessageBox.Show(timesStamp2.ToString());
|
||||
|
||||
//如果使用如果是WebSocket + TLS + Web模式,需要检测域名解析是否正确
|
||||
if (appConfig.Contains("WebSocketTLSWeb") == true)
|
||||
{
|
||||
|
@ -583,6 +617,9 @@ namespace ProxySU
|
|||
//启动Caddy服务
|
||||
client.RunCommand("caddy -service start");
|
||||
}
|
||||
|
||||
|
||||
|
||||
//生成客户端配置
|
||||
currentStatus = "生成客户端配置......";
|
||||
textBlockName.Dispatcher.BeginInvoke(updateAction, textBlockName, progressBar, currentStatus);
|
||||
|
@ -851,10 +888,13 @@ namespace ProxySU
|
|||
var connectionInfo = new PasswordConnectionInfo(sshHostName, sshPort, sshUser, sshPassword);
|
||||
using (var client = new SshClient(connectionInfo))
|
||||
{
|
||||
//client.Connect();
|
||||
|
||||
|
||||
//client.Disconnect();
|
||||
client.Connect();
|
||||
//MessageBox.Show(client.RunCommand("date +%s").Result.ToString());
|
||||
long timesStamp1 = Convert.ToInt64(client.RunCommand("date +%s").Result.ToString());
|
||||
MessageBox.Show(timesStamp1.ToString());
|
||||
long timesStamp2 = timesStamp1 - 300;
|
||||
MessageBox.Show(timesStamp2.ToString());
|
||||
client.Disconnect();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -938,6 +978,31 @@ namespace ProxySU
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Button_Click_5(object sender, RoutedEventArgs e)
|
||||
{
|
||||
TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
|
||||
long timeStamp = Convert.ToInt64(ts.TotalSeconds);
|
||||
MessageBox.Show(timeStamp.ToString());
|
||||
|
||||
//DateTime dateNow = DateTime.Now;
|
||||
//MessageBox.Show(TimeZoneInfo.ConvertTimeToUtc(dateNow).ToString());
|
||||
//Console.WriteLine("The date and time are {0} UTC.",
|
||||
// TimeZoneInfo.ConvertTimeToUtc(dateNow));
|
||||
}
|
||||
|
||||
private void ButtonProofreadTime_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ConnectionInfo connectionInfo = GenerateConnectionInfo();
|
||||
if (connectionInfo == null)
|
||||
{
|
||||
MessageBox.Show("远程主机连接信息有误,请检查");
|
||||
return;
|
||||
}
|
||||
ProofreadTimeWindow proofreadTimeWindow = new ProofreadTimeWindow();
|
||||
ProofreadTimeWindow.ProfreadTimeReceiveConnectionInfo = connectionInfo;
|
||||
proofreadTimeWindow.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
24
ProxySU/ProofreadTimeWindow.xaml
Normal file
24
ProxySU/ProofreadTimeWindow.xaml
Normal file
|
@ -0,0 +1,24 @@
|
|||
<Window x:Class="ProxySU.ProofreadTimeWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:ProxySU"
|
||||
mc:Ignorable="d"
|
||||
Title="ProofreadTimeWindow" Height="450" Width="600">
|
||||
<Grid>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Button x:Name="ButtonTestTime" Content="检测时间误差是否在合理" Grid.Column="0" Grid.Row="0" Margin="5" Click="ButtonTestTime_Click"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
71
ProxySU/ProofreadTimeWindow.xaml.cs
Normal file
71
ProxySU/ProofreadTimeWindow.xaml.cs
Normal file
|
@ -0,0 +1,71 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
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;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.IO;
|
||||
using Renci.SshNet;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System.Drawing;
|
||||
using QRCoder;
|
||||
|
||||
namespace ProxySU
|
||||
{
|
||||
/// <summary>
|
||||
/// ProofreadTimeWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ProofreadTimeWindow : Window
|
||||
{
|
||||
public static ConnectionInfo ProfreadTimeReceiveConnectionInfo { get; set; }
|
||||
//ProfreadTimeReceiveParameters
|
||||
public ProofreadTimeWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
}
|
||||
|
||||
private void ButtonTestTime_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
using (var client = new SshClient(ProfreadTimeReceiveConnectionInfo))
|
||||
{
|
||||
client.Connect();
|
||||
long timeStampVPS = Convert.ToInt64(client.RunCommand("date +%s").Result.ToString());
|
||||
//MessageBox.Show(timesStampVPS.ToString());
|
||||
//获取本地时间戳
|
||||
TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
|
||||
long timeStampLocal = Convert.ToInt64(ts.TotalSeconds);
|
||||
client.Disconnect();
|
||||
if (Math.Abs(timeStampLocal - timeStampVPS) >= 90)
|
||||
{
|
||||
|
||||
MessageBox.Show("本地时间与远程主机时间相差超过限制(90秒),请先用\"系统工具-->时间校对\"校对时间后再设置");
|
||||
//currentStatus = "时间较对失败......";
|
||||
//textBlockName.Dispatcher.BeginInvoke(updateAction, textBlockName, progressBar, currentStatus);
|
||||
//Thread.Sleep(1000);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("误差为:"+Math.Abs(timeStampLocal - timeStampVPS).ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//MainWindow.ConnectionInfo
|
||||
//using (var client = new SshClient(MainWindow.ConnectionInfo))
|
||||
|
||||
}
|
||||
}
|
|
@ -81,6 +81,9 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="ProofreadTimeWindow.xaml.cs">
|
||||
<DependentUpon>ProofreadTimeWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ResultClientInformation.xaml.cs">
|
||||
<DependentUpon>ResultClientInformation.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
@ -99,6 +102,10 @@
|
|||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Page Include="ProofreadTimeWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="ResultClientInformation.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue