Skip to content

Commit

Permalink
增加更多的错误提示信息
Browse files Browse the repository at this point in the history
  • Loading branch information
proxysu committed Oct 14, 2020
1 parent 2e9a49d commit 3697231
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ProxySU/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ProxySU"
mc:Ignorable="d"
Title="ProxySU - v2.4.4" Height="675" Width="650">
Title="ProxySU - v2.4.5" Height="675" Width="650">
<!--以下样式参考自:https://yq.aliyun.com/articles/331878
https://docs.microsoft.com/en-us/dotnet/desktop-wpf/fundamentals/styles-templates-overview-->
<Window.Resources>
Expand Down
35 changes: 31 additions & 4 deletions ProxySU/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11634,7 +11634,28 @@ private void Button_Click(object sender, RoutedEventArgs e)
using (var client = new SshClient(connectionInfo))
{
client.Connect();
SoftInstalledSuccessOrFail(client, "v2ray", @"/usr/local/bin/v2ray");
if (client.IsConnected == true)
{
//******"主机登录成功"******
SetUpProgressBarProcessing(3);
currentStatus = Application.Current.FindResource("DisplayInstallInfo_LoginSuccessful").ToString();
MainWindowsShowInfo(currentStatus);

}
//string cmdErr = client.RunCommand(@"aaa ee").Error;
//MessageBox.Show(cmdErr);
SshCommand cmdResult = client.RunCommand(@"pwd");
string result = cmdResult.Result;
MessageBox.Show("result:"+result);
string error = cmdResult.Error;
MessageBox.Show("err:"+error);

SshCommand cmdResultCat = client.RunCommand(@"cat tt.t");
string resultCat = cmdResultCat.Result;
MessageBox.Show("resultCat:" + resultCat);
string errorCat = cmdResultCat.Error;
MessageBox.Show("errCat:" + errorCat);
//SoftInstalledSuccessOrFail(client, "v2ray", @"/usr/local/bin/v2ray");
//CaddyInstall(client);
//if (client.IsConnected == true)
//{
Expand Down Expand Up @@ -11686,7 +11707,10 @@ private string MainWindowsShowInfo(string currentStatus)
private string MainWindowsShowCmd(SshClient client,string sshShellCommand)
{
TextBoxMonitorCommandResults.Dispatcher.BeginInvoke(updateMonitorAction, TextBoxMonitorCommandResults, sshShellCommand);//显示执行的命令
string currentShellCommandResult = client.RunCommand(sshShellCommand).Result;
SshCommand cmdResult = client.RunCommand(sshShellCommand);
string currentShellCommandResult = cmdResult.Result;
string currentShellCommandError = cmdResult.Error;
if (String.IsNullOrEmpty(currentShellCommandResult) == true) { currentShellCommandResult = currentShellCommandError; }
TextBoxMonitorCommandResults.Dispatcher.BeginInvoke(updateMonitorAction, TextBoxMonitorCommandResults, currentShellCommandResult);//显示命令执行的结果

return currentShellCommandResult;
Expand Down Expand Up @@ -11792,7 +11816,7 @@ private bool SoftInstalledIsNoYes(SshClient client,string soft,string condition)
}

//检测关闭Selinux及系统组件是否齐全(apt/yum/dnf/systemctl)11--30
//安装依赖软件,检测端口,防火墙开启端口,升级systemctl
//安装依赖软件,检测端口,防火墙开启端口
//functionResult = ShutDownSelinuxAndSysComponentsDetect(client);
//if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
private bool ShutDownSelinuxAndSysComponentsDetect(SshClient client)
Expand Down Expand Up @@ -12221,7 +12245,10 @@ private bool DomainResolutionCurrentIPDetect(SshClient client)


//安装代理程序 37--40

private bool SoftInstall()
{
return true;
}

//程序是否安装成功检测并设置开机启动 41--43
//soft--要检测的程序
Expand Down
4 changes: 2 additions & 2 deletions ProxySU/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.4.4.0")]
[assembly: AssemblyFileVersion("2.4.4.0")]
[assembly: AssemblyVersion("2.4.5.0")]
[assembly: AssemblyFileVersion("2.4.5.0")]
Binary file modified ProxySU/bin/Beta/Beta.zip
Binary file not shown.

0 comments on commit 3697231

Please sign in to comment.