From 34a081e8f97c2a67ec2726dc362602d1487790c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20=C5=A0taleker?= Date: Wed, 11 Sep 2024 06:07:11 +0200 Subject: [PATCH] sftp settings premakjen --- InfosysPublisher/Classes/Settings.cs | 22 ---------------------- InfosysPublisher/WinMain.xaml.cs | 8 ++++++-- InfosysPublisher/WinSettings.xaml | 20 ++------------------ InfosysPublisher/WinSettings.xaml.cs | 8 -------- 4 files changed, 8 insertions(+), 50 deletions(-) diff --git a/InfosysPublisher/Classes/Settings.cs b/InfosysPublisher/Classes/Settings.cs index 2207ca6..5e80f4b 100644 --- a/InfosysPublisher/Classes/Settings.cs +++ b/InfosysPublisher/Classes/Settings.cs @@ -13,31 +13,9 @@ namespace InfosysPublisher.Classes { public class Application { - //SQL strežniki - //Privatna polja - [JsonProperty] private string _sftpUsername; - [JsonProperty] private string _sftpPassword; - - //Javna polja - public string SftpServerAddress { get; set; } - public int SftpPort { get; set; } public int BuildSeconds { get; set; } public string LastFolder { get; set; } - [JsonIgnore] - public string SftpUsername - { - get => _sftpUsername.AesDecrypt(); - set => _sftpUsername = value.AesEncrypt(); - } - - [JsonIgnore] - public string SftpPassword - { - get => _sftpPassword.AesDecrypt(); - set => _sftpPassword = value.AesEncrypt(); - } - public void Save(string iPath) { var json = JsonConvert.SerializeObject(this); diff --git a/InfosysPublisher/WinMain.xaml.cs b/InfosysPublisher/WinMain.xaml.cs index af22d8e..7e21578 100644 --- a/InfosysPublisher/WinMain.xaml.cs +++ b/InfosysPublisher/WinMain.xaml.cs @@ -49,6 +49,11 @@ namespace InfosysPublisher private string _selectedProjectVersion = ""; private string _selectedProjectGuid = ""; + private static readonly string SftpServerAddress = "192.168.111.75"; + private static readonly int SftpPort = 300; + private static readonly string SftpUsername = "InfosysUpdate"; + private static readonly string SftpPassword = "v&H6c$wTbTkgSgdWvL*8k$st3#z5X"; + private const string SftpArchivePath = "Archive"; public WinMain() { @@ -341,8 +346,7 @@ namespace InfosysPublisher { try { - using var sftpClient = new SftpClient(App._application.SftpServerAddress, App._application.SftpPort, - App._application.SftpUsername, App._application.SftpPassword); + using var sftpClient = new SftpClient(SftpServerAddress, SftpPort, SftpUsername, SftpPassword); sftpClient.Connect(); if (!sftpClient.Exists(_selectedProjectPublishLocation)) diff --git a/InfosysPublisher/WinSettings.xaml b/InfosysPublisher/WinSettings.xaml index 2293fe2..9471b12 100644 --- a/InfosysPublisher/WinSettings.xaml +++ b/InfosysPublisher/WinSettings.xaml @@ -9,29 +9,13 @@ Title="WinSettings" Height="355" Width="355"> - - - - - - - - - - - - - - - - - - + + diff --git a/InfosysPublisher/WinSettings.xaml.cs b/InfosysPublisher/WinSettings.xaml.cs index ca811ec..066fcb9 100644 --- a/InfosysPublisher/WinSettings.xaml.cs +++ b/InfosysPublisher/WinSettings.xaml.cs @@ -43,10 +43,6 @@ namespace InfosysPublisher { var settings = new Settings.Application { - SftpServerAddress = TbSftpServer.Text, - SftpPort = Convert.ToInt32(TbSftpPort.Text), - SftpUsername = TbSftpUsername.Text, - SftpPassword = TbSftpPassword.Text, BuildSeconds = Convert.ToInt32(TbBuildDuration.Text) }; @@ -59,10 +55,6 @@ namespace InfosysPublisher { var settings = GetSettings() ?? new Settings.Application(); - TbSftpServer.Text = settings.SftpServerAddress; - TbSftpPort.Text = settings.SftpPort.ToString(); - TbSftpUsername.Text = settings.SftpUsername; - TbSftpPassword.Text = settings.SftpPassword; TbBuildDuration.Text = settings.BuildSeconds.ToString(); }