Metodo x generazione caratteri casuali x auth code + nuova vers

This commit is contained in:
Samuele E. Locatelli
2019-10-14 18:59:17 +02:00
parent c9afae9c8c
commit b9ef6587d4
2 changed files with 22 additions and 1 deletions
Vendored
+1 -1
View File
@@ -11,7 +11,7 @@ pipeline {
steps {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=672']) {
withEnv(['NEXT_BUILD_NUMBER=673']) {
// env.versionNumber = VersionNumber(versionNumberString : '3.3.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
env.versionNumber = VersionNumber(versionNumberString : '3.3.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.versionNumberBeta = VersionNumber(versionNumberString : '3.3.${BUILD_DATE_FORMATTED, "yyMM"}-beta.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
+21
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
namespace SteamWare
@@ -381,6 +382,26 @@ namespace SteamWare
// ritorno
return numAuth;
}
/// <summary>
/// Generazione stringa casuale di caratteri...
/// </summary>
/// <param name="size"></param>
/// <param name="lowerCase"></param>
/// <returns></returns>
public static string RandomString(int size, bool lowerCase)
{
StringBuilder builder = new StringBuilder();
Random random = new Random();
char ch;
for (int i = 0; i < size; i++)
{
ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65)));
builder.Append(ch);
}
if (lowerCase)
return builder.ToString().ToLower();
return builder.ToString();
}
#endregion