Compare commits

...

16 Commits

Author SHA1 Message Date
Samuele Locatelli 5f422d3cc6 tolto gestione rilettura appconf mitigata (da testare meglio...) 2021-08-11 15:26:41 +02:00
Samuele Locatelli 5292da811b Merge branch 'develop' 2021-08-10 18:52:47 +02:00
Samuele Locatelli 8ec8e76fb5 Fix versione progetto con ddHH 2021-08-10 18:52:06 +02:00
Samuele Locatelli bfcd476190 Merge tag 'fixConcurrent_resetAppConf' into develop
Gestione semaforo x evitare reset multiplo in fase di rilettura appConf
2021-08-10 18:49:58 +02:00
Samuele Locatelli eb722c6e44 Merge branch 'release/fixConcurrent_resetAppConf' 2021-08-10 18:49:40 +02:00
Samuele Locatelli 502d5ba092 Riorg classe + fix metodo reset appConfRedis con semaforo (redis) 2021-08-10 18:48:49 +02:00
Samuele Locatelli 1cb1878e8a Merge branch 'develop' 2021-07-16 18:00:45 +02:00
Samuele Locatelli a54cd875ce refresh 2021-07-16 18:00:40 +02:00
Samuele Locatelli 4ab4a9c0ae Update modalità log di base 2021-07-16 18:00:35 +02:00
Samuele Locatelli f1762a078f Refresh pacchetto x test download 2021-07-16 15:59:20 +02:00
Samuele Locatelli 8781679ce7 Merge tag '5.1' into develop
Inserito download da nexus authenticated
2021-05-27 15:47:30 +02:00
Samuele Locatelli 3c8d351438 Merge branch 'release/5.1' 2021-05-27 15:47:17 +02:00
Samuele Locatelli d980229ac0 update rel vers 2021-05-27 15:47:06 +02:00
Samuele Locatelli a53530569d Merge branch 'feature/UpdManNexus' into develop 2021-05-27 15:46:06 +02:00
Samuele Locatelli bdbc91f83a Aggiornato componente gesitone update sw 2021-05-27 15:45:54 +02:00
Samuele Locatelli ae562ec3cc inizio modifica x updMan autenticato 2021-05-27 13:23:38 +02:00
7 changed files with 3205 additions and 2908 deletions
Vendored
+3 -6
View File
@@ -7,12 +7,9 @@ pipeline {
steps { steps {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */ /* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script { script {
withEnv(['NEXT_BUILD_NUMBER=757']) { env.versionNumber = VersionNumber(versionNumberString : '5.1.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILD_DATE_FORMATTED, "ddHH"}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
// env.versionNumber = VersionNumber(versionNumberString : '5.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumberBeta = VersionNumber(versionNumberString : '5.1.${BUILD_DATE_FORMATTED, "yyMM"}-beta.${BUILD_DATE_FORMATTED, "ddHH"}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.versionNumber = VersionNumber(versionNumberString : '5.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'SteamWareLib'
env.versionNumberBeta = VersionNumber(versionNumberString : '5.0.${BUILD_DATE_FORMATTED, "yyMM"}-beta.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.APP_NAME = 'SteamWareLib'
}
} }
script { script {
currentBuild.displayName = "${env.versionNumber}" currentBuild.displayName = "${env.versionNumber}"
+1678 -1588
View File
File diff suppressed because it is too large Load Diff
+202 -136
View File
@@ -4,160 +4,226 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Xml; using System.Xml;
namespace SteamWare namespace SteamWare
{ {
/// <summary>
/// Gestione update applicazioni
/// </summary>
public class UpdateMan
{
/// <summary> /// <summary>
/// Init classe /// Object of this class gives you all the details about the update useful in handling the update logic yourself.
/// </summary> /// </summary>
protected UpdateMan() public class UpdateInfoEventArgs : EventArgs
{ }
/// <summary>
/// Init classe
/// </summary>
public static UpdateMan obj = new UpdateMan();
/// <summary>
/// Recupera l'ultima versione disponibile
/// </summary>
/// <param name="remoteUrl"></param>
/// <returns></returns>
public UpdateInfoEventArgs getUpdateInfo(string remoteUrl)
{ {
UpdateInfoEventArgs args = new UpdateInfoEventArgs(); #region Public Properties
Version CurrentVersion;
bool Mandatory; /// <summary>
XmlDocument recXml = new XmlDocument(); /// URL of the webpage specifying changes in the new update.
try /// </summary>
{ public string ChangelogURL { get; set; }
// recupero dati
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.CreateHttp(remoteUrl); /// <summary>
HttpWebResponse remData = (HttpWebResponse)request.GetResponse(); /// Returns newest version of the application available to download.
// converto in XML /// </summary>
recXml.Load(remData.GetResponseStream()); public Version CurrentVersion { get; set; }
XmlNodeList recData = recXml.SelectNodes("item");
if (recData != null) /// <summary>
{ /// Download URL of the update file.
foreach (XmlNode item in recData) /// </summary>
{ public string DownloadURL { get; set; }
XmlNode appCastVersion = item.SelectSingleNode("version");
Version.TryParse(appCastVersion?.InnerText, out CurrentVersion); /// <summary>
args.CurrentVersion = CurrentVersion; /// Returns version of the application currently installed on the user's PC.
XmlNode appCastChangeLog = item.SelectSingleNode("changelog"); /// </summary>
args.ChangelogURL = appCastChangeLog?.InnerText; public Version InstalledVersion { get; set; }
XmlNode appCastUrl = item.SelectSingleNode("url");
args.DownloadURL = appCastUrl?.InnerText; /// <summary>
XmlNode mandatory = item.SelectSingleNode("mandatory"); /// If new update is available then returns true otherwise false.
Boolean.TryParse(mandatory?.InnerText, out Mandatory); /// </summary>
args.Mandatory = Mandatory; public bool IsUpdateAvailable { get; set; }
args.IsUpdateAvailable = true;
} /// <summary>
} /// Shows if the update is required or optional.
} /// </summary>
catch public bool Mandatory { get; set; }
{
// metto versione = 0 + errore... #endregion Public Properties
args.IsUpdateAvailable = false;
args.CurrentVersion= new Version("0.0.0.0");
}
return args;
} }
/// <summary> /// <summary>
/// Effettua download ultima versione applicativo /// Gestione update applicazioni
/// </summary> /// </summary>
/// <param name="remoteUrl"></param> public class UpdateMan
/// <param name="localRepo"></param>
/// <param name="packName"></param>
public int downloadLatest(string remoteUrl, string localRepo, string packName)
{ {
int done = 0; #region Public Fields
// verifico directory
if (!Directory.Exists(localRepo)) /// <summary>
{ /// Init classe
Directory.CreateDirectory(localRepo); /// </summary>
} public static UpdateMan obj = new UpdateMan();
string localFile = "";
string localLast = ""; #endregion Public Fields
try
{ #region Public Constructors
// in primis scarico update info...
UpdateInfoEventArgs updateData = getUpdateInfo(remoteUrl); /// <summary>
if (updateData.IsUpdateAvailable) /// Init classe
/// </summary>
public UpdateMan()
{ }
/// <summary>
/// Init classe
/// </summary>
/// <param name="user"></param>
/// <param name="pwd"></param>
public UpdateMan(string user, string pwd)
{ {
string DownloadURL = updateData.DownloadURL; userName = user;
localFile = string.Format(@"{0}\{2}_Build_{1}.zip", localRepo, updateData.CurrentVersion, packName); passwd = pwd;
localLast = string.Format(@"{0}\{1}.zip", localRepo, packName);
// scarica file e salva in directory locale...
var client = new WebClient();
client.DownloadFile(updateData.DownloadURL, localFile);
// ora lo copio come latest...
File.Copy(localFile, localLast, true);
// indico come fatto!
done = 1;
} }
else
#endregion Public Constructors
#region Protected Properties
protected string passwd { get; set; } = "";
protected string userName { get; set; } = "";
#endregion Protected Properties
#region Public Methods
/// <summary>
/// Effettua download ultima versione applicativo
/// </summary>
/// <param name="remoteUrl"></param>
/// <param name="localRepo"></param>
/// <param name="packName"></param>
public int downloadLatest(string remoteUrl, string localRepo, string packName)
{ {
localFile = string.Format(@"{0}\Error.log", localRepo); int done = 0;
// scrivo file in area target... // verifico directory
using (StreamWriter sw = File.AppendText(localFile)) if (!Directory.Exists(localRepo))
{ {
sw.WriteLine(string.Format("{0:yyyy-MM-dd HH:mm:ss} ATTENZIONE! Installer NON disponibile | {1}", DateTime.Now, remoteUrl)); Directory.CreateDirectory(localRepo);
} }
string localFile = "";
string localLast = "";
try
{
// in primis scarico update info...
UpdateInfoEventArgs updateData = getUpdateInfo(remoteUrl);
if (updateData.IsUpdateAvailable)
{
string DownloadURL = updateData.DownloadURL;
localFile = string.Format(@"{0}\{1}_Build_{2}.zip", localRepo, packName, updateData.CurrentVersion);
localLast = string.Format(@"{0}\{1}.zip", localRepo, packName);
// scarica file e salva in directory locale...
var client = new WebClient();
bool doAuth = !string.IsNullOrEmpty($"{userName}{passwd}");
if (doAuth)
{
client.Credentials = new System.Net.NetworkCredential(userName, passwd);
}
client.DownloadFile(updateData.DownloadURL, localFile);
// ora lo copio come latest...
File.Copy(localFile, localLast, true);
// indico come fatto!
done = 1;
}
else
{
localFile = string.Format(@"{0}\Error.log", localRepo);
// scrivo file in area target...
using (StreamWriter sw = File.AppendText(localFile))
{
sw.WriteLine(string.Format("{0:yyyy-MM-dd HH:mm:ss} ATTENZIONE! Installer NON disponibile | {1}", DateTime.Now, remoteUrl));
}
}
}
catch (Exception exc)
{
localFile = string.Format(@"{0}\Error.log", localRepo);
// scrivo file in area target...
using (StreamWriter sw = File.AppendText(localFile))
{
sw.WriteLine(string.Format("{0:yyyy-MM-dd HH:mm:ss} Errore in fase di download installers per {1}", DateTime.Now, remoteUrl));
sw.WriteLine(exc.ToString());
}
}
return done;
} }
}
catch (Exception exc) /// <summary>
{ /// Recupera l'ultima versione disponibile
localFile = string.Format(@"{0}\Error.log", localRepo); /// </summary>
// scrivo file in area target... /// <param name="remoteUrl"></param>
using (StreamWriter sw = File.AppendText(localFile)) /// <returns></returns>
public UpdateInfoEventArgs getUpdateInfo(string remoteUrl)
{ {
sw.WriteLine(string.Format("{0:yyyy-MM-dd HH:mm:ss} Errore in fase di download installers per {1}", DateTime.Now, remoteUrl)); bool doAuth = !string.IsNullOrEmpty($"{userName}{passwd}");
sw.WriteLine(exc.ToString());
UpdateInfoEventArgs args = new UpdateInfoEventArgs();
Version CurrentVersion;
bool Mandatory;
XmlDocument recXml = new XmlDocument();
try
{
// recupero dati
using (var http = new HttpClient())
{
if (doAuth)
{
http.DefaultRequestHeaders.Accept.Clear();
var byteArray = System.Text.ASCIIEncoding.UTF8.GetBytes($"{userName}:{passwd}");
http.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
}
// url da chiamare
http.BaseAddress = new Uri(remoteUrl);
// lettura
var data = http.GetAsync(remoteUrl).Result;
var myReader = data.Content.ReadAsStreamAsync();
if (data.StatusCode != HttpStatusCode.OK)
{
logger.lg.scriviLog($"Errore in chiamata getUpdateInfo per URL {remoteUrl}: status code: {data.StatusCode}", tipoLog.INFO);
}
else
{
recXml.Load(myReader.Result);
XmlNodeList recData = recXml.SelectNodes("item");
if (recData != null)
{
foreach (XmlNode item in recData)
{
XmlNode appCastVersion = item.SelectSingleNode("version");
Version.TryParse(appCastVersion?.InnerText, out CurrentVersion);
args.CurrentVersion = CurrentVersion;
XmlNode appCastChangeLog = item.SelectSingleNode("changelog");
args.ChangelogURL = appCastChangeLog?.InnerText;
XmlNode appCastUrl = item.SelectSingleNode("url");
args.DownloadURL = appCastUrl?.InnerText;
XmlNode mandatory = item.SelectSingleNode("mandatory");
Boolean.TryParse(mandatory?.InnerText, out Mandatory);
args.Mandatory = Mandatory;
args.IsUpdateAvailable = true;
}
}
}
}
}
catch (Exception exc)
{
logger.lg.scriviLog($"Eccezione in getUpdateInfo:{Environment.NewLine}{exc}");
// metto versione = 0 + errore...
args.IsUpdateAvailable = false;
args.CurrentVersion = new Version("0.0.0.0");
}
return args;
} }
}
return done; #endregion Public Methods
} }
}
/// <summary>
/// Object of this class gives you all the details about the update useful in handling the update logic yourself.
/// </summary>
public class UpdateInfoEventArgs : EventArgs
{
/// <summary>
/// If new update is available then returns true otherwise false.
/// </summary>
public bool IsUpdateAvailable { get; set; }
/// <summary>
/// Download URL of the update file.
/// </summary>
public string DownloadURL { get; set; }
/// <summary>
/// URL of the webpage specifying changes in the new update.
/// </summary>
public string ChangelogURL { get; set; }
/// <summary>
/// Returns newest version of the application available to download.
/// </summary>
public Version CurrentVersion { get; set; }
/// <summary>
/// Returns version of the application currently installed on the user's PC.
/// </summary>
public Version InstalledVersion { get; set; }
/// <summary>
/// Shows if the update is required or optional.
/// </summary>
public bool Mandatory { get; set; }
}
} }
+1 -1
View File
@@ -629,7 +629,7 @@ namespace SteamWare
protected void newLogfileName() protected void newLogfileName()
{ {
DateTime CurrentDateTime = DateTime.Now; DateTime CurrentDateTime = DateTime.Now;
_logfileName = _logBaseDir + String.Format("{0}.log", CurrentDateTime.ToString("yyyyMMdd")); _logfileName = _logBaseDir + String.Format("{0}.log", CurrentDateTime.ToString("yyyy-MM-dd"));
} }
/// <summary> /// <summary>
+1104 -1098
View File
File diff suppressed because it is too large Load Diff
+134 -11
View File
@@ -49,6 +49,7 @@
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage2 = new System.Windows.Forms.TabPage(); this.tabPage2 = new System.Windows.Forms.TabPage();
this.tabPage3 = new System.Windows.Forms.TabPage(); this.tabPage3 = new System.Windows.Forms.TabPage();
this.btnResetAppConf = new System.Windows.Forms.Button();
this.lblTestLogger = new System.Windows.Forms.Label(); this.lblTestLogger = new System.Windows.Forms.Label();
this.chkTestLogger = new System.Windows.Forms.CheckBox(); this.chkTestLogger = new System.Windows.Forms.CheckBox();
this.btnResetCdv = new System.Windows.Forms.Button(); this.btnResetCdv = new System.Windows.Forms.Button();
@@ -79,9 +80,18 @@
this.txtQueueMessage = new System.Windows.Forms.TextBox(); this.txtQueueMessage = new System.Windows.Forms.TextBox();
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox();
this.lblQueueRead = new System.Windows.Forms.Label(); this.lblQueueRead = new System.Windows.Forms.Label();
this.tabPage7 = new System.Windows.Forms.TabPage();
this.btnDownload = new System.Windows.Forms.Button();
this.lblOutUpdMan = new System.Windows.Forms.Label();
this.btnReadUpdMan = new System.Windows.Forms.Button();
this.txtRemoteUrl = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.txtPass = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.txtUser = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.clockTimer = new System.Windows.Forms.Timer(this.components); this.clockTimer = new System.Windows.Forms.Timer(this.components);
this.LogTimer = new System.Windows.Forms.Timer(this.components); this.LogTimer = new System.Windows.Forms.Timer(this.components);
this.btnResetAppConf = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
@@ -94,6 +104,7 @@
this.groupBox3.SuspendLayout(); this.groupBox3.SuspendLayout();
this.grpPublisher.SuspendLayout(); this.grpPublisher.SuspendLayout();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
this.tabPage7.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// groupBox1 // groupBox1
@@ -266,6 +277,7 @@
this.tabControl1.Controls.Add(this.tabPage4); this.tabControl1.Controls.Add(this.tabPage4);
this.tabControl1.Controls.Add(this.tabPage5); this.tabControl1.Controls.Add(this.tabPage5);
this.tabControl1.Controls.Add(this.tabPage6); this.tabControl1.Controls.Add(this.tabPage6);
this.tabControl1.Controls.Add(this.tabPage7);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0); this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Name = "tabControl1"; this.tabControl1.Name = "tabControl1";
@@ -314,6 +326,16 @@
this.tabPage3.Text = "Redis test"; this.tabPage3.Text = "Redis test";
this.tabPage3.UseVisualStyleBackColor = true; this.tabPage3.UseVisualStyleBackColor = true;
// //
// btnResetAppConf
//
this.btnResetAppConf.Location = new System.Drawing.Point(576, 13);
this.btnResetAppConf.Name = "btnResetAppConf";
this.btnResetAppConf.Size = new System.Drawing.Size(114, 23);
this.btnResetAppConf.TabIndex = 16;
this.btnResetAppConf.Text = "ResetAppConf";
this.btnResetAppConf.UseVisualStyleBackColor = true;
this.btnResetAppConf.Click += new System.EventHandler(this.btnResetAppConf_Click);
//
// lblTestLogger // lblTestLogger
// //
this.lblTestLogger.AutoSize = true; this.lblTestLogger.AutoSize = true;
@@ -646,6 +668,105 @@
this.lblQueueRead.TabIndex = 1; this.lblQueueRead.TabIndex = 1;
this.lblQueueRead.Text = "..."; this.lblQueueRead.Text = "...";
// //
// tabPage7
//
this.tabPage7.Controls.Add(this.btnDownload);
this.tabPage7.Controls.Add(this.lblOutUpdMan);
this.tabPage7.Controls.Add(this.btnReadUpdMan);
this.tabPage7.Controls.Add(this.txtRemoteUrl);
this.tabPage7.Controls.Add(this.label11);
this.tabPage7.Controls.Add(this.txtPass);
this.tabPage7.Controls.Add(this.label10);
this.tabPage7.Controls.Add(this.txtUser);
this.tabPage7.Controls.Add(this.label9);
this.tabPage7.Location = new System.Drawing.Point(4, 22);
this.tabPage7.Name = "tabPage7";
this.tabPage7.Padding = new System.Windows.Forms.Padding(3);
this.tabPage7.Size = new System.Drawing.Size(768, 353);
this.tabPage7.TabIndex = 6;
this.tabPage7.Text = "Update Man";
this.tabPage7.UseVisualStyleBackColor = true;
//
// btnDownload
//
this.btnDownload.Location = new System.Drawing.Point(496, 15);
this.btnDownload.Name = "btnDownload";
this.btnDownload.Size = new System.Drawing.Size(175, 23);
this.btnDownload.TabIndex = 8;
this.btnDownload.Text = "Download latest";
this.btnDownload.UseVisualStyleBackColor = true;
this.btnDownload.Click += new System.EventHandler(this.btnDownload_Click);
//
// lblOutUpdMan
//
this.lblOutUpdMan.AutoSize = true;
this.lblOutUpdMan.Location = new System.Drawing.Point(19, 76);
this.lblOutUpdMan.Name = "lblOutUpdMan";
this.lblOutUpdMan.Size = new System.Drawing.Size(16, 13);
this.lblOutUpdMan.TabIndex = 7;
this.lblOutUpdMan.Text = "---";
//
// btnReadUpdMan
//
this.btnReadUpdMan.Location = new System.Drawing.Point(315, 15);
this.btnReadUpdMan.Name = "btnReadUpdMan";
this.btnReadUpdMan.Size = new System.Drawing.Size(175, 23);
this.btnReadUpdMan.TabIndex = 6;
this.btnReadUpdMan.Text = "Retrieve Info";
this.btnReadUpdMan.UseVisualStyleBackColor = true;
this.btnReadUpdMan.Click += new System.EventHandler(this.btnReadUpdMan_Click);
//
// txtRemoteUrl
//
this.txtRemoteUrl.Location = new System.Drawing.Point(60, 43);
this.txtRemoteUrl.Name = "txtRemoteUrl";
this.txtRemoteUrl.Size = new System.Drawing.Size(611, 20);
this.txtRemoteUrl.TabIndex = 5;
this.txtRemoteUrl.Text = "http://nexus.steamware.net/repository/SWS/ZCode/master/LAST/manifest.xml";
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(19, 46);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(20, 13);
this.label11.TabIndex = 4;
this.label11.Text = "Url";
//
// txtPass
//
this.txtPass.Location = new System.Drawing.Point(209, 17);
this.txtPass.Name = "txtPass";
this.txtPass.Size = new System.Drawing.Size(100, 20);
this.txtPass.TabIndex = 3;
this.txtPass.Text = "viaD@nte16";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(168, 20);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(30, 13);
this.label10.TabIndex = 2;
this.label10.Text = "Pass";
//
// txtUser
//
this.txtUser.Location = new System.Drawing.Point(60, 17);
this.txtUser.Name = "txtUser";
this.txtUser.Size = new System.Drawing.Size(100, 20);
this.txtUser.TabIndex = 1;
this.txtUser.Text = "SWDownloader";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(19, 20);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(29, 13);
this.label9.TabIndex = 0;
this.label9.Text = "User";
//
// clockTimer // clockTimer
// //
this.clockTimer.Interval = 50; this.clockTimer.Interval = 50;
@@ -656,16 +777,6 @@
this.LogTimer.Interval = 10; this.LogTimer.Interval = 10;
this.LogTimer.Tick += new System.EventHandler(this.LogTimer_Tick); this.LogTimer.Tick += new System.EventHandler(this.LogTimer_Tick);
// //
// btnResetAppConf
//
this.btnResetAppConf.Location = new System.Drawing.Point(576, 13);
this.btnResetAppConf.Name = "btnResetAppConf";
this.btnResetAppConf.Size = new System.Drawing.Size(114, 23);
this.btnResetAppConf.TabIndex = 16;
this.btnResetAppConf.Text = "ResetAppConf";
this.btnResetAppConf.UseVisualStyleBackColor = true;
this.btnResetAppConf.Click += new System.EventHandler(this.btnResetAppConf_Click);
//
// MainForm // MainForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -697,6 +808,8 @@
this.grpPublisher.PerformLayout(); this.grpPublisher.PerformLayout();
this.groupBox2.ResumeLayout(false); this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout(); this.groupBox2.PerformLayout();
this.tabPage7.ResumeLayout(false);
this.tabPage7.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@@ -757,6 +870,16 @@
private System.Windows.Forms.CheckBox chkTestLogger; private System.Windows.Forms.CheckBox chkTestLogger;
private System.Windows.Forms.Timer LogTimer; private System.Windows.Forms.Timer LogTimer;
private System.Windows.Forms.Button btnResetAppConf; private System.Windows.Forms.Button btnResetAppConf;
private System.Windows.Forms.TabPage tabPage7;
private System.Windows.Forms.TextBox txtPass;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox txtUser;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox txtRemoteUrl;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label lblOutUpdMan;
private System.Windows.Forms.Button btnReadUpdMan;
private System.Windows.Forms.Button btnDownload;
} }
} }
+15
View File
@@ -61,6 +61,21 @@ namespace TestBench
} }
} }
private void btnDownload_Click(object sender, EventArgs e)
{
var currUpdMan = new UpdateMan(txtUser.Text.Trim(), txtPass.Text.Trim());
currUpdMan.downloadLatest(txtRemoteUrl.Text.Trim(), "c:\\Temp", "MP-STATS");
}
private void btnReadUpdMan_Click(object sender, EventArgs e)
{
// recupero i dati dall'URL
var currUpdMan = new UpdateMan(txtUser.Text.Trim(), txtPass.Text.Trim());
// popolo la label
var updInfo = currUpdMan.getUpdateInfo(txtRemoteUrl.Text.Trim());
lblOutUpdMan.Text = $"Vers: {updInfo.CurrentVersion} | URL: {updInfo.DownloadURL}";
}
private void btnResetAppConf_Click(object sender, EventArgs e) private void btnResetAppConf_Click(object sender, EventArgs e)
{ {
memLayer.ML.resetAppConf(); memLayer.ML.resetAppConf();