修改发布小工具

This commit is contained in:
2023-05-04 11:58:34 +08:00
parent 4ea9f7e6ea
commit 19bd2467f0
8 changed files with 340 additions and 36 deletions
+25 -1
View File
@@ -5,12 +5,36 @@ using System.Text;
try
{
// SCP Settings
string scpHost = "123.56.94.154";
string scpUsername = "Administrator";
string scpPassword = "WHxckj2019";
// SCP Connection
using (var scpClient = new ScpClient(scpHost, scpUsername, scpPassword))
{
scpClient.Connect();
// Upload File using SCP
using (var fs = new FileStream(@"D:\favicon.png", FileMode.Open))
{
//默认是C盘根目录
scpClient.Upload(fs, @"/mytest/favicon.png");
}
scpClient.Disconnect();
}
// 创建一个SSH客户端实例
using (var client = new SshClient("123.56.94.154", "Administrator", "WHxckj2019"))
{
// 连接到远程服务器
client.Connect();
//&& .\\IRaCIS_Vue_Web.bat
//&& ./IRaCIS_Vue_Web.bat
string command = $@"cd C:\Users\Administrator\VueSourceCode && npm i && npm run build";