Override x gestione naming forzato file upload
This commit is contained in:
+114
-101
@@ -15,62 +15,62 @@ namespace MConnectSDK
|
||||
{
|
||||
/// <summary>
|
||||
/// Client per connessione a MaestroConnect
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
public class MConnectClient
|
||||
{
|
||||
#region oggetti base ed init
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto accesso memoria...
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected memLayer ML;
|
||||
/// <summary>
|
||||
/// Parametri di comunicazione attivi
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected confParam _currParam;
|
||||
/// <summary>
|
||||
/// ID univoco dell'HMI per piattaforma MaestroConnect
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected string MachineID;
|
||||
/// <summary>
|
||||
/// ID applicativo/client per piattaforma MaestroConnect (differente per UTE)
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected string ClientID;
|
||||
/// <summary>
|
||||
/// Determina se il server redis sia attivo e connesso (check periodico...)
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
public bool redServAlive;
|
||||
/// <summary>
|
||||
/// DataOra ultimo controllo stato server REDIS
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected DateTime lastRedSrvCheck;
|
||||
/// <summary>
|
||||
/// Intervallo di default x recall successive
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected int waitRecall = 1000;
|
||||
/// <summary>
|
||||
/// URL x chiamata auth WebApp / QR-code da YAML...
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected string WebAppUrl = @"https://smart.maestroconnect.com/deviceauth?user_code={0}&machineID={1}";
|
||||
/// <summary>
|
||||
/// URL BASE per le chiamate
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected string BaseUrl = @"https://stg.maestroconnect.scmgroup.com/";
|
||||
/// <summary>
|
||||
/// URL BASE per le chiamate upload
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected string UploadUrl = @"https://stg.maestroconnect.scmgroup.com/storage-api/backups";
|
||||
/// <summary>
|
||||
/// URL BASE per le chiamate
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected string PingTarget = @"stg.maestroconnect.scmgroup.com";
|
||||
/// <summary>
|
||||
/// URL per test HEALT del cloud
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected string AliveTarget = @"https://stg.api.maestroconnect.scmgroup.com/health";
|
||||
/// <summary>
|
||||
/// DateTime di watchdog
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected DateTime watchDog
|
||||
{
|
||||
get
|
||||
@@ -92,11 +92,11 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// TTL lungo in REDIS (10 min)
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected int longTTL = 600;
|
||||
/// <summary>
|
||||
/// Stato della richiesta attuale tornato
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected Result reqStatus
|
||||
{
|
||||
get
|
||||
@@ -118,7 +118,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Ultima response controllo enroll
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected enrollResponse enrollResp
|
||||
{
|
||||
get
|
||||
@@ -143,7 +143,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Ultima response elenco utenti
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected userListResponse usrListResp
|
||||
{
|
||||
get
|
||||
@@ -168,7 +168,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Ultimo token response ottenuto (e salvato in REDIS)
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected tokenResponse tokResp
|
||||
{
|
||||
get
|
||||
@@ -193,7 +193,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica se sia necessario rigenerare il token...
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected bool tokenDone
|
||||
{
|
||||
get
|
||||
@@ -209,7 +209,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Risposta della chiamata di verifica
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected verificationSuccessResponse verifResp
|
||||
{
|
||||
get
|
||||
@@ -231,7 +231,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Risposta della chiamata di clientInfo
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected clientInfoResponse clientInfoResp
|
||||
{
|
||||
get
|
||||
@@ -253,7 +253,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica se sia necessario rifare la fase di verifica x i token di auth...
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected bool verificationDone
|
||||
{
|
||||
get
|
||||
@@ -269,7 +269,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// AccessToken
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected string access_token
|
||||
{
|
||||
get
|
||||
@@ -281,7 +281,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// RefreshToken
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected string refresh_token
|
||||
{
|
||||
get
|
||||
@@ -293,7 +293,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// DateTime di enroll (se futuro = NON enrolled)
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected DateTime enrollDate
|
||||
{
|
||||
get
|
||||
@@ -315,7 +315,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Elenco utenti (in cache locale)
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected List<UserData> userListCache
|
||||
{
|
||||
get
|
||||
@@ -338,7 +338,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Utente corrente (SE login OK)
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected UserData currUser
|
||||
{
|
||||
get
|
||||
@@ -361,7 +361,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Elenco utenti (in cache locale)
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected List<userPwdData> userPwdLocalCache
|
||||
{
|
||||
get
|
||||
@@ -389,7 +389,7 @@ namespace MConnectSDK
|
||||
|
||||
/// <summary>
|
||||
/// URL pagina per check enroll (parametrico)
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected string pageUrlCheckEnroll
|
||||
{
|
||||
get
|
||||
@@ -403,7 +403,7 @@ namespace MConnectSDK
|
||||
|
||||
/// <summary>
|
||||
/// URL pagina per Download Immagini ( https://firebasestorage.googleapis.com/v0/b/scm-mconnect.appspot.com/o/ )
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected string pageUrlImgDownload
|
||||
{
|
||||
get
|
||||
@@ -414,8 +414,8 @@ namespace MConnectSDK
|
||||
|
||||
/// <summary>
|
||||
/// Effettua test preliminare stato...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// {ext}<summary>
|
||||
/// <returns>{ext}<returns>
|
||||
private Result preCheckStatus()
|
||||
{
|
||||
Result answ = new Result()
|
||||
@@ -464,7 +464,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Controlla stato server alive
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
private bool checkRedisAlive()
|
||||
{
|
||||
bool newStatus = ML.connRedis.IsConnected;
|
||||
@@ -484,7 +484,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Aggiorna stato redis server + invio dati pending
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
private void setWatchdog()
|
||||
{
|
||||
// verifico eventuali invii pending... SE connesso...
|
||||
@@ -496,7 +496,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Effettua lo step 1 di chiamata x ottenere il TOKEN iniziale
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
private void doTokenStep()
|
||||
{
|
||||
// parametri chiamata
|
||||
@@ -514,7 +514,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Effetuo step 3: /verification
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
private bool doVerificationStep()
|
||||
{
|
||||
bool answ = false;
|
||||
@@ -565,7 +565,7 @@ namespace MConnectSDK
|
||||
|
||||
/// <summary>
|
||||
/// Inizializzazione classe specificando il file di conf con i parametri
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
public MConnectClient()
|
||||
{
|
||||
|
||||
@@ -574,8 +574,8 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Parsing file di configurazione
|
||||
/// </summary>
|
||||
/// <param name="confFilePath"></param>
|
||||
/// {ext}<summary>
|
||||
/// <param name="confFilePath">{ext}<param>
|
||||
private void parseConfFile(string confFilePath)
|
||||
{
|
||||
confParam param = new confParam();
|
||||
@@ -626,7 +626,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Forza svuotamento di TUTTI i dati in REDIS
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
public void forceRedisFlush()
|
||||
{
|
||||
// svuoto TUTTI i dati x INIT...
|
||||
@@ -634,11 +634,11 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Metodo di INIT della classe di comunicazione
|
||||
/// </summary>
|
||||
/// <param name="confFilePath"></param>
|
||||
/// <param name="token">Token, che può benissimo essere CancellationToken.None</param>
|
||||
/// <param name="progress"></param>
|
||||
/// <returns></returns>
|
||||
/// {ext}<summary>
|
||||
/// <param name="confFilePath">{ext}<param>
|
||||
/// <param name="token">Token, che può benissimo essere CancellationToken.None{ext}<param>
|
||||
/// <param name="progress">{ext}<param>
|
||||
/// <returns>{ext}<returns>
|
||||
public async Task<Result> InitSDKAsync(string confFilePath, CancellationToken token, IProgress<Result> progress = null)
|
||||
{
|
||||
// controlloare file di conf se valido... = "mconnect.conf.yaml"
|
||||
@@ -656,8 +656,8 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Recupera status del client
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// {ext}<summary>
|
||||
/// <returns>{ext}<returns>
|
||||
public async Task<Result> GetClientStatusAsync()
|
||||
{
|
||||
var currReq = reqStatus;
|
||||
@@ -709,8 +709,8 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Fa un controllo sulla risposta, eventualmente rinnova il token di accesso restituendo SE HA FATTO refresh (quindi serve nuova chiamata)
|
||||
/// </summary>
|
||||
/// <param name="rawResult"></param>
|
||||
/// {ext}<summary>
|
||||
/// <param name="rawResult">{ext}<param>
|
||||
private bool checkFixToken(string rawResult)
|
||||
{
|
||||
bool answ = false;
|
||||
@@ -736,7 +736,7 @@ namespace MConnectSDK
|
||||
|
||||
/// <summary>
|
||||
/// Effettua una chaimata alla funzione di refresh del token di comunicazione
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
private void refreshAuthToken()
|
||||
{
|
||||
// parametri chiamata
|
||||
@@ -756,10 +756,10 @@ namespace MConnectSDK
|
||||
|
||||
/// <summary>
|
||||
/// Recupera status del client
|
||||
/// </summary>
|
||||
/// <param name="token">Token, che può benissimo essere CancellationToken.None</param>
|
||||
/// <param name="progress"></param>
|
||||
/// <returns></returns>
|
||||
/// {ext}<summary>
|
||||
/// <param name="token">Token, che può benissimo essere CancellationToken.None{ext}<param>
|
||||
/// <param name="progress">{ext}<param>
|
||||
/// <returns>{ext}<returns>
|
||||
public async Task<Result> GetClientStatusAsync(CancellationToken token, IProgress<Result> progress = null)
|
||||
{
|
||||
await Task.Run(() =>
|
||||
@@ -789,8 +789,8 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Tentativo AUTH
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// {ext}<summary>
|
||||
/// <returns>{ext}<returns>
|
||||
public ActivationPayload tryAuthorize()
|
||||
{
|
||||
// init output
|
||||
@@ -838,9 +838,9 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Effettua vera chiamata enroll
|
||||
/// </summary>
|
||||
/// <param name="pageUrl"></param>
|
||||
/// <returns></returns>
|
||||
/// {ext}<summary>
|
||||
/// <param name="pageUrl">{ext}<param>
|
||||
/// <returns>{ext}<returns>
|
||||
public string doEnroll()
|
||||
{
|
||||
string answ = "";
|
||||
@@ -855,7 +855,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Effettua verifica enroll (chiamando organization + machineID)
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
protected bool checkEnroll()
|
||||
{
|
||||
bool answ = false;
|
||||
@@ -885,8 +885,8 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Tentativo ENROLL
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// {ext}<summary>
|
||||
/// <returns>{ext}<returns>
|
||||
public ActivationPayload tryEnroll()
|
||||
{
|
||||
// init output
|
||||
@@ -940,8 +940,8 @@ namespace MConnectSDK
|
||||
|
||||
/// <summary>
|
||||
/// Metodo x ottenere update richiesta
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// {ext}<summary>
|
||||
/// <returns>{ext}<returns>
|
||||
public Result reqStatusUpd
|
||||
{
|
||||
get
|
||||
@@ -952,7 +952,7 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Restituisce codice organizzazione
|
||||
/// </summary>
|
||||
/// {ext}<summary>
|
||||
public string organizationCode
|
||||
{
|
||||
get
|
||||
@@ -969,9 +969,9 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Recupera elenco user x organizzazione corrente
|
||||
/// </summary>
|
||||
/// <param name="getImages">Indica se scaricare ANCHE TUTTE le immagini degli utenti (default = false)</param>
|
||||
/// <returns></returns>
|
||||
/// {ext}<summary>
|
||||
/// <param name="getImages">Indica se scaricare ANCHE TUTTE le immagini degli utenti (default = false){ext}<param>
|
||||
/// <returns>{ext}<returns>
|
||||
public async Task<Result> getUserListAsync(bool getImages = false)
|
||||
{
|
||||
var _currStatus = reqStatus;
|
||||
@@ -992,9 +992,9 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Elenco utenti da MaestroConnect
|
||||
/// </summary>
|
||||
/// <param name="getImages">Indica se scaricare ANCHE TUTTE le immagini degli utenti (default = false)</param>
|
||||
/// <returns></returns>
|
||||
/// {ext}<summary>
|
||||
/// <param name="getImages">Indica se scaricare ANCHE TUTTE le immagini degli utenti (default = false){ext}<param>
|
||||
/// <returns>{ext}<returns>
|
||||
private List<UserData> userListMConnect(bool getImages = false)
|
||||
{
|
||||
List<UserData> answ = new List<UserData>();
|
||||
@@ -1067,8 +1067,8 @@ namespace MConnectSDK
|
||||
|
||||
/// <summary>
|
||||
/// Recupera elenco user di Maestro connect registrati come CREATI sul client/HMI x organizzazione corrente
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// {ext}<summary>
|
||||
/// <returns>{ext}<returns>
|
||||
public async Task<Result> getUserImportedListAsync()
|
||||
{
|
||||
var _currStatus = reqStatus;
|
||||
@@ -1099,11 +1099,11 @@ namespace MConnectSDK
|
||||
|
||||
/// <summary>
|
||||
/// Imposta UN SINGOLO utente come importato (<see langword="true"/>) o eliminato(false)
|
||||
/// </summary>
|
||||
/// <param name="sender">CHI invia la richeista (x decidere come impostare status), HMI = LOCAL</param>
|
||||
/// <param name="username"></param>
|
||||
/// <param name="imported">true=importato / false = cancellato/non + importato</param>
|
||||
/// <returns></returns>
|
||||
/// {ext}<summary>
|
||||
/// <param name="sender">CHI invia la richeista (x decidere come impostare status), HMI = LOCAL{ext}<param>
|
||||
/// <param name="username">{ext}<param>
|
||||
/// <param name="imported">true=importato / false = cancellato/non + importato{ext}<param>
|
||||
/// <returns>{ext}<returns>
|
||||
public async Task<Result> setUserImported(SourceType sender, string username, bool imported = true)
|
||||
{
|
||||
var _currStatus = reqStatus;
|
||||
@@ -1172,10 +1172,10 @@ namespace MConnectSDK
|
||||
|
||||
/// <summary>
|
||||
/// Effettua login e restituisce dati utente
|
||||
/// </summary>
|
||||
/// <param name="username"></param>
|
||||
/// <param name="password"></param>
|
||||
/// <returns></returns>
|
||||
/// {ext}<summary>
|
||||
/// <param name="username">{ext}<param>
|
||||
/// <param name="password">{ext}<param>
|
||||
/// <returns>{ext}<returns>
|
||||
public async Task<Result> TryUserLogin(string username, string password)
|
||||
{
|
||||
var _currStatus = reqStatus;
|
||||
@@ -1379,8 +1379,8 @@ namespace MConnectSDK
|
||||
|
||||
/// <summary>
|
||||
/// Effettua update userList
|
||||
/// <param name="getImages">Indica se scaricare ANCHE TUTTE le immagini degli utenti (default = false)</param>
|
||||
/// </summary>
|
||||
/// <param name="getImages">Indica se scaricare ANCHE TUTTE le immagini degli utenti (default = false){ext}<param>
|
||||
/// {ext}<summary>
|
||||
private void updateUserListCacheFromCloud(bool getImages = false)
|
||||
{
|
||||
// se NON modalità testing LEGGO davvero da cloud la NUOVA lista
|
||||
@@ -1391,10 +1391,10 @@ namespace MConnectSDK
|
||||
|
||||
/// <summary>
|
||||
/// Generazione HASH password salted
|
||||
/// </summary>
|
||||
/// <param name="_plainText"></param>
|
||||
/// <param name="_salt"></param>
|
||||
/// <returns></returns>
|
||||
/// {ext}<summary>
|
||||
/// <param name="_plainText">{ext}<param>
|
||||
/// <param name="_salt">{ext}<param>
|
||||
/// <returns>{ext}<returns>
|
||||
protected string GenerateSaltedHash(string _plainText, string _salt)
|
||||
{
|
||||
byte[] plainText = Encoding.ASCII.GetBytes(_plainText);
|
||||
@@ -1419,10 +1419,10 @@ namespace MConnectSDK
|
||||
|
||||
/// <summary>
|
||||
/// Task x AUTH
|
||||
/// </summary>
|
||||
/// <param name="token"></param>
|
||||
/// <param name="progress"></param>
|
||||
/// <returns></returns>
|
||||
/// {ext}<summary>
|
||||
/// <param name="token">{ext}<param>
|
||||
/// <param name="progress">{ext}<param>
|
||||
/// <returns>{ext}<returns>
|
||||
public async Task<Result> TryActivationAsync(CancellationToken token, IProgress<Result> progress)
|
||||
{
|
||||
// predispongo il payload da allegare alla result...
|
||||
@@ -1479,10 +1479,10 @@ namespace MConnectSDK
|
||||
}
|
||||
/// <summary>
|
||||
/// Task x AUTH
|
||||
/// </summary>
|
||||
/// <param name="token"></param>
|
||||
/// <param name="progress"></param>
|
||||
/// <returns></returns>
|
||||
/// {ext}<summary>
|
||||
/// <param name="token">{ext}<param>
|
||||
/// <param name="progress">{ext}<param>
|
||||
/// <returns>{ext}<returns>
|
||||
public async Task<Result> EnrollMachineAsync(CancellationToken token, IProgress<Result> progress)
|
||||
{
|
||||
// predispongo il payload da allegare alla result...
|
||||
@@ -1539,7 +1539,17 @@ namespace MConnectSDK
|
||||
// return finale dello status della chiamata...
|
||||
return _currReq;
|
||||
}
|
||||
public async Task<Result> TryUpLoadFile(CancellationToken token, IProgress<Result> progress, string fileName)
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Classe x caricamento files
|
||||
/// {ext}<summary>
|
||||
/// <param name="token">{ext}<param>
|
||||
/// <param name="progress">{ext}<param>
|
||||
/// <param name="fileName">Nem file (PATH COMPLETO) da caricare{ext}<param>
|
||||
/// <param name="uploadName">Nome da dare al file per il caricamento (con cui sarà nominato al download), se nullo/empty --> impostato BACKUP.{ext}<param>
|
||||
/// <returns>{ext}<returns>
|
||||
public async Task<Result> TryUpLoadFile(CancellationToken token, IProgress<Result> progress, string fileName, string uploadName = "")
|
||||
{
|
||||
Result result = new Result();
|
||||
|
||||
@@ -1549,14 +1559,17 @@ namespace MConnectSDK
|
||||
result.Payload = new FilePayload();
|
||||
result.CallResultOk = false;
|
||||
GatewayPayload resp = new GatewayPayload();
|
||||
string fileExt = Path.GetExtension(fileName);
|
||||
string nomeFile = string.Format("Backup{0}", fileExt);
|
||||
if (uploadName == null || uploadName == "")
|
||||
{
|
||||
string fileExt = Path.GetExtension(fileName);
|
||||
uploadName = string.Format("Backup{0}", fileExt);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
byte[] fileBytes = File.ReadAllBytes(fileName);
|
||||
// effettuo call EFFETTIVA
|
||||
var taskRes = Task.Run(() => Utils.uploadAsync(UploadUrl, nomeFile, fileBytes));
|
||||
var taskRes = Task.Run(() => Utils.uploadAsync(UploadUrl, uploadName, fileBytes));
|
||||
taskRes.Wait();
|
||||
var rawResult = taskRes.Result;
|
||||
// leggo la risposta in var temporanea...
|
||||
|
||||
@@ -220,7 +220,7 @@ namespace TestClient
|
||||
QRCodeGenerator qrGenerator = new QRCodeGenerator();
|
||||
QRCodeData qrCodeData = qrGenerator.CreateQrCode(authData.QrCode, QRCodeGenerator.ECCLevel.Q);
|
||||
QRCode qrCode = new QRCode(qrCodeData);
|
||||
Bitmap qrCodeImage = qrCode.GetGraphic(5);
|
||||
Bitmap qrCodeImage = qrCode.GetGraphic(5);
|
||||
pictBox.Image = qrCodeImage;
|
||||
|
||||
#if false
|
||||
|
||||
Reference in New Issue
Block a user