This commit is contained in:
backuppc
2025-07-08 11:16:43 +09:00
parent d537030eb3
commit 8efe357430
11 changed files with 380 additions and 97 deletions

View File

@@ -20,25 +20,44 @@ namespace VNCServerList.Services
{
try
{
var vncViewerPath = _settingsService.GetSettings().VNCViewerPath;
var settings = _settingsService.GetSettings();
var vncViewerPath = settings.VNCViewerPath;
if (!File.Exists(vncViewerPath))
{
throw new FileNotFoundException($"VNC Viewer를 찾을 수 없습니다: {vncViewerPath}");
}
// 서버의 argument가 없으면 설정의 기본 argument 사용
var arguments = $"-host={server.IP}";
if (!string.IsNullOrEmpty(server.Argument))
{
arguments += $" {server.Argument}";
}
else if (!string.IsNullOrEmpty(settings.Argument))
{
arguments += $" {settings.Argument}";
}
// 비밀번호가 있으면 추가
if (!string.IsNullOrEmpty(server.Password))
{
arguments += $" -password={server.Password}";
}
System.Diagnostics.Debug.WriteLine($"VNC 실행: 경로='{vncViewerPath}', 인수='{arguments}'");
// VNC Viewer 실행
var startInfo = new ProcessStartInfo
{
FileName = vncViewerPath,
Arguments = $"-host={server.IP} {server.Argument}",
Arguments = arguments,
UseShellExecute = true
};
Process.Start(startInfo);
// 연결 성공 (마지막 연결 시간 업데이트는 현재 테이블 구조에 없으므로 제거)
return true;
}
catch (Exception ex)