Skip to content

Commit

Permalink
v3.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
msasanmh committed Oct 14, 2024
1 parent 1b79c53 commit 47a0a46
Show file tree
Hide file tree
Showing 100 changed files with 6,267 additions and 5,295 deletions.
12 changes: 6 additions & 6 deletions ConsoleAppTest/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ static async Task Main(string[] args)
fragment.Set(AgnosticProgram.Fragment.Mode.Program, 50, AgnosticProgram.Fragment.ChunkMode.SNI, 5, 2, 1);
server1.EnableFragment(fragment);

AgnosticProgram.DnsRules dnsRules1 = new();
dnsRules1.Set(AgnosticProgram.DnsRules.Mode.Text, dnsRulesContent);
server1.EnableDnsRules(dnsRules1);
AgnosticProgram.Rules dnsRules1 = new();
await dnsRules1.SetAsync(AgnosticProgram.Rules.Mode.Text, dnsRulesContent);
server1.EnableRules(dnsRules1);

AgnosticProgram.ProxyRules proxyRules1 = new();
proxyRules1.Set(AgnosticProgram.ProxyRules.Mode.Text, proxyRulesContent);
server1.EnableProxyRules(proxyRules1);
AgnosticProgram.Rules proxyRules1 = new();
await proxyRules1.SetAsync(AgnosticProgram.Rules.Mode.Text, proxyRulesContent);
server1.EnableRules(proxyRules1);


List<string> dnsServers2 = new()
Expand Down
5 changes: 3 additions & 2 deletions MsmhToolsClass/MsmhToolsClass.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>AnyCPU;x64;x86</Platforms>
<Version>$(VersionPrefix)1.6.5</Version>
<Version>$(VersionPrefix)1.6.6</Version>
<Copyright>MSasanMH</Copyright>
</PropertyGroup>

Expand Down Expand Up @@ -190,11 +190,12 @@

<ItemGroup>
<PackageReference Include="libsodium" Version="1.0.20" />
<PackageReference Include="MaxMind.GeoIP2" Version="5.2.0" />
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="3.1.8" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.2.18" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="8.0.0" />
<PackageReference Include="System.DirectoryServices.AccountManagement" Version="8.0.0" />
<PackageReference Include="System.Drawing.Common" Version="8.0.6" />
<PackageReference Include="System.Drawing.Common" Version="8.0.8" />
<PackageReference Include="System.Management" Version="8.0.0" />
<PackageReference Include="System.Management.Automation" Version="7.2.18" />
<PackageReference Include="TaskScheduler" Version="2.11.0" />
Expand Down
20 changes: 19 additions & 1 deletion MsmhToolsClass/MsmhToolsClass/ExtensionsMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,24 @@ public static List<List<T>> SplitToLists<T>(this List<T> list, int nSize)
}
//-----------------------------------------------------------------------------------
public static List<string> SplitToLines(this string s)
{
List<string> lines = new();

try
{
s = s.ReplaceLineEndings();
string[] split = s.Split(Environment.NewLine);
if (split.Length > 0) lines = split.ToList();
}
catch (Exception ex)
{
Debug.WriteLine("ExtensionsMethods SplitToLines: " + ex.Message);
}

return lines;
}

public static List<string> SplitToLinesOld(this string s)
{
// Original non-optimized version: return source.Replace("\r\r\n", "\n").Replace("\r\n", "\n").Replace('\r', '\n').Replace('\u2028', '\n').Split('\n');
List<string> lines = new();
Expand Down Expand Up @@ -400,7 +418,7 @@ public static List<string> SplitToLines(this string s)
}
catch (Exception ex)
{
Debug.WriteLine("ExtensionsMethods ToString<T>: " + ex.Message);
Debug.WriteLine("ExtensionsMethods SplitToLinesOld: " + ex.Message);
}

return lines;
Expand Down
Loading

0 comments on commit 47a0a46

Please sign in to comment.