private static string UnEncryptString(string d) { if ((d == null) || (d == "") || (d.Length < 2)) { return(""); } int i; ReplaceKey rk = new ReplaceKey(); for (i = 51; i >= 0; i--) { d = d.Replace(rk.Key[1, i], rk.Key[0, i]); } int len, Key = int.Parse(d.Substring(0, 3)); int[] Keys = new int[3]; Keys[0] = Key / 100; Keys[1] = (Key % 100) / 10; Keys[2] = (Key % 10); d = d.Substring(3, d.Length - 3); len = d.Length / 3; byte[] Byte = new byte[len]; for (i = 0; i < len; i++) { Byte[i] = (byte)(int.Parse(d.Substring(i * 3, 3)) - Keys[i % 3]); } return(System.Text.Encoding.UTF8.GetString(Byte)); }
private static void FindMultipleRegex(ref string s, string find, IDictionary <int, ReplaceKey> indexes) { MatchCollection matchs = new Regex(find, RegexOptions.IgnoreCase).Matches(s); for (int i = 0; i < matchs.Count; i++) { ReplaceKey key = new ReplaceKey { Key = find, Length = matchs[i].Length }; indexes.Add(matchs[i].Index, key); } }
internal AppStack(Construct scope, RecipeConfiguration <Configuration> recipeConfiguration, IStackProps props = null) : base(scope, recipeConfiguration.StackName, props) { var bucketProps = new BucketProps { WebsiteIndexDocument = recipeConfiguration.Settings.IndexDocument, PublicReadAccess = true, // Turn on delete objects so deployed Blazor application is deleted when the stack is deleted. AutoDeleteObjects = true, RemovalPolicy = RemovalPolicy.DESTROY }; if (recipeConfiguration.Settings.Redirect404ToRoot) { bucketProps.WebsiteRoutingRules = new IRoutingRule[] { new RoutingRule { Condition = new RoutingRuleCondition { HttpErrorCodeReturnedEquals = "404" }, ReplaceKey = ReplaceKey.With("") } }; } if (!string.IsNullOrEmpty(recipeConfiguration.Settings.ErrorDocument)) { bucketProps.WebsiteErrorDocument = recipeConfiguration.Settings.ErrorDocument; } var bucket = new Bucket(this, "BlazorHost", bucketProps); new BucketDeployment(this, "BlazorDeployment", new BucketDeploymentProps { Sources = new ISource[] { Source.Asset(Path.Combine(recipeConfiguration.DotnetPublishOutputDirectory, "wwwroot")) }, DestinationBucket = bucket }); new CfnOutput(this, "EndpointURL", new CfnOutputProps { Value = $"http://{bucket.BucketWebsiteDomainName}/" }); }
private static void FindMultipleString(ref string s, string find, IDictionary <int, ReplaceKey> indexes) { int index; int startIndex = 0; do { index = s.IndexOf(find, startIndex); if (index >= 0) { ReplaceKey key = new ReplaceKey { Key = find, Length = find.Length }; indexes.Add(index, key); startIndex = index + find.Length; } }while (index >= 0); }
private static string UnEncryptString(string d) { if ((d == null) || (d == "") || (d.Length < 2)) return ""; int i; ReplaceKey rk = new ReplaceKey(); for (i = 51; i >= 0; i--) d = d.Replace(rk.Key[1, i], rk.Key[0, i]); int len, Key = int.Parse(d.Substring(0, 3)); int[] Keys = new int[3]; Keys[0] = Key / 100; Keys[1] = (Key % 100) / 10; Keys[2] = (Key % 10); d = d.Substring(3, d.Length - 3); len = d.Length / 3; byte[] Byte = new byte[len]; for (i = 0; i < len; i++) Byte[i] = (byte)(int.Parse(d.Substring(i * 3, 3)) - Keys[i % 3]); return System.Text.Encoding.UTF8.GetString(Byte); }
private static string UnEncryptString(string d) { int num; if (((d == null) || (d == "")) || (d.Length < 2)) { return ""; } ReplaceKey key = new ReplaceKey(); for (num = 0x33; num >= 0; num--) { d = d.Replace(key.Key[1, num], key.Key[0, num]); } int num2 = int.Parse(d.Substring(0, 3)); int[] numArray = new int[] { num2 / 100, (num2 % 100) / 10, num2 % 10 }; d = d.Substring(3, d.Length - 3); int num3 = d.Length / 3; byte[] bytes = new byte[num3]; for (num = 0; num < num3; num++) { bytes[num] = (byte)(int.Parse(d.Substring(num * 3, 3)) - numArray[num % 3]); } return Encoding.UTF8.GetString(bytes); }