This commit is contained in:
parent
3a151ec733
commit
f90ad8ff41
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -18,7 +18,7 @@
|
|||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 11,
|
||||
"SelectedChildIndex": 12,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
|
@ -64,6 +64,10 @@
|
|||
"$type": "Bookmark",
|
||||
"Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}"
|
||||
},
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:1:0:{e8b06f52-6d01-11d2-aa7d-00c04f990343}"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
|
@ -72,7 +76,7 @@
|
|||
"RelativeDocumentMoniker": "Program.cs",
|
||||
"ToolTip": "C:\\Repos\\BlockIPAddr\\Program.cs",
|
||||
"RelativeToolTip": "Program.cs",
|
||||
"ViewState": "AgIAABgAAAAAAAAAAAAAACoAAAAHAAAAAAAAAA==",
|
||||
"ViewState": "AgIAAB4AAAAAAAAAAAAAADsAAAAKAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2025-06-27T16:11:33.579Z",
|
||||
"EditorCaption": ""
|
||||
|
@ -87,7 +91,8 @@
|
|||
"RelativeToolTip": "ClassObj\\ANSI.cs",
|
||||
"ViewState": "AgIAADgAAAAAAAAAAAAAAEoAAAARAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2025-06-30T08:09:46.703Z"
|
||||
"WhenOpened": "2025-06-30T08:09:46.703Z",
|
||||
"EditorCaption": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 11,
|
||||
"SelectedChildIndex": 12,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
|
@ -64,6 +64,10 @@
|
|||
"$type": "Bookmark",
|
||||
"Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}"
|
||||
},
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:1:0:{e8b06f52-6d01-11d2-aa7d-00c04f990343}"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
|
@ -72,7 +76,7 @@
|
|||
"RelativeDocumentMoniker": "Program.cs",
|
||||
"ToolTip": "C:\\Repos\\BlockIPAddr\\Program.cs",
|
||||
"RelativeToolTip": "Program.cs",
|
||||
"ViewState": "AgIAABgAAAAAAAAAAAAAACoAAAAHAAAAAAAAAA==",
|
||||
"ViewState": "AgIAACAAAAAAAAAAAAAAADsAAAAKAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2025-06-27T16:11:33.579Z",
|
||||
"EditorCaption": ""
|
||||
|
@ -87,7 +91,8 @@
|
|||
"RelativeToolTip": "ClassObj\\ANSI.cs",
|
||||
"ViewState": "AgIAADgAAAAAAAAAAAAAAEoAAAARAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2025-06-30T08:09:46.703Z"
|
||||
"WhenOpened": "2025-06-30T08:09:46.703Z",
|
||||
"EditorCaption": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
60
Program.cs
60
Program.cs
|
@ -11,6 +11,8 @@ internal class Program
|
|||
{
|
||||
ConsoleColorization.Initialize(); // Allow ANSI in the console
|
||||
|
||||
var theEntries = new List<string>();
|
||||
|
||||
if (args.Length > 0)
|
||||
{
|
||||
Console.WriteLine();
|
||||
|
@ -24,15 +26,23 @@ internal class Program
|
|||
string rv;
|
||||
string color = string.Empty;
|
||||
|
||||
if (!IsValid(arg))
|
||||
Console.WriteLine("{0}ERROR: '{1}{2}{0}' is not a valid IP4 address.{3}", ANSI.fgBrightRed, ANSI.fgBrightWhite, arg.Trim(), ANSI.fgReset);
|
||||
else
|
||||
{
|
||||
cm.Parameters["@ip4"].Value = arg.Trim();
|
||||
rv = cm.ExecuteScalar().ToString() ?? string.Empty;
|
||||
theEntries.Clear();
|
||||
theEntries.AddRange(arg.Split(','));
|
||||
|
||||
color = rv.StartsWith("!!") ? ANSI.fgBrightRed : ANSI.fgBrightYellow;
|
||||
Console.WriteLine("Result: {1}{0}{2}", rv, color, ANSI.fgReset);
|
||||
foreach(var entry in theEntries)
|
||||
{
|
||||
string ip4 = entry.Trim();
|
||||
|
||||
if (!IsValid(ip4))
|
||||
Console.WriteLine("{0}ERROR: '{1}{2}{0}' is not a valid IP4 address.{3}", ANSI.fgBrightRed, ANSI.fgBrightWhite, ip4, ANSI.fgReset);
|
||||
else
|
||||
{
|
||||
cm.Parameters["@ip4"].Value = ip4;
|
||||
rv = cm.ExecuteScalar().ToString() ?? string.Empty;
|
||||
|
||||
color = rv.StartsWith("!!") ? ANSI.fgBrightRed : ANSI.fgBrightYellow;
|
||||
Console.WriteLine("Result: {1}{0}{2}", rv, color, ANSI.fgReset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -47,21 +57,27 @@ internal class Program
|
|||
if (string.IsNullOrWhiteSpace(ip4))
|
||||
break;
|
||||
|
||||
if (!IsValid(ip4))
|
||||
Console.WriteLine("\n{0}ERROR: '{1}{2}{0}' is not a valid IP4 address.{3}", ANSI.fgBrightRed, ANSI.fgBrightWhite, ip4, ANSI.fgReset);
|
||||
else
|
||||
{
|
||||
using (var cn = new SqlConnection(kmCommonLibsCore.Constants.cnPortal))
|
||||
using (var cm = new SqlCommand("dbo.[BlockIPAddrInFirewall]", cn) { CommandType = System.Data.CommandType.StoredProcedure })
|
||||
{
|
||||
string color = string.Empty;
|
||||
string rv = string.Empty;
|
||||
cn.Open();
|
||||
cm.Parameters.Add("@ip4", System.Data.SqlDbType.VarChar, 30).Value = ip4;
|
||||
rv = cm.ExecuteScalar().ToString() ?? string.Empty;
|
||||
theEntries.Clear();
|
||||
theEntries.AddRange(ip4.Split(','));
|
||||
|
||||
color = rv.StartsWith("!!") ? ANSI.fgBrightRed : ANSI.fgBrightYellow;
|
||||
Console.WriteLine("\nResult: {1}{0}{2}", rv, color, ANSI.fgReset);
|
||||
foreach (var entry in theEntries)
|
||||
{
|
||||
if (!IsValid(entry.Trim()))
|
||||
Console.WriteLine("\n{0}ERROR: '{1}{2}{0}' is not a valid IP4 address.{3}", ANSI.fgBrightRed, ANSI.fgBrightWhite, entry.Trim(), ANSI.fgReset);
|
||||
else
|
||||
{
|
||||
using (var cn = new SqlConnection(kmCommonLibsCore.Constants.cnPortal))
|
||||
using (var cm = new SqlCommand("dbo.[BlockIPAddrInFirewall]", cn) { CommandType = System.Data.CommandType.StoredProcedure })
|
||||
{
|
||||
string color = string.Empty;
|
||||
string rv = string.Empty;
|
||||
cn.Open();
|
||||
cm.Parameters.Add("@ip4", System.Data.SqlDbType.VarChar, 30).Value = entry.Trim();
|
||||
rv = cm.ExecuteScalar().ToString() ?? string.Empty;
|
||||
|
||||
color = rv.StartsWith("!!") ? ANSI.fgBrightRed : ANSI.fgBrightYellow;
|
||||
Console.WriteLine("\nResult for {3}: {1}{0}{2}", rv, color, ANSI.fgReset, entry.Trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<!-- https://go.microsoft.com/fwlink/?LinkID=208121. -->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<History>True|2025-06-30T08:59:56.4591901Z||;True|2025-06-30T04:39:28.6629030-04:00||;True|2025-06-30T04:04:51.2689872-04:00||;True|2025-06-30T04:02:09.8676131-04:00||;True|2025-06-27T12:28:32.0039427-04:00||;True|2025-06-27T12:27:16.4031564-04:00||;True|2025-06-27T12:23:51.7850485-04:00||;True|2025-06-27T12:13:48.5390689-04:00||;True|2025-06-27T12:12:59.9985493-04:00||;</History>
|
||||
<History>True|2025-08-04T07:56:39.0297504Z||;True|2025-06-30T04:59:56.4591901-04:00||;True|2025-06-30T04:39:28.6629030-04:00||;True|2025-06-30T04:04:51.2689872-04:00||;True|2025-06-30T04:02:09.8676131-04:00||;True|2025-06-27T12:28:32.0039427-04:00||;True|2025-06-27T12:27:16.4031564-04:00||;True|2025-06-27T12:23:51.7850485-04:00||;True|2025-06-27T12:13:48.5390689-04:00||;True|2025-06-27T12:12:59.9985493-04:00||;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -9,8 +9,8 @@
|
|||
"BlockIPAddr/1.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Data.SqlClient": "6.0.2",
|
||||
"Microsoft.DotNet.ILCompiler": "9.0.5",
|
||||
"Microsoft.NET.ILLink.Tasks": "9.0.5",
|
||||
"Microsoft.DotNet.ILCompiler": "9.0.7",
|
||||
"Microsoft.NET.ILLink.Tasks": "9.0.7",
|
||||
"kmCommonLibsCore": "2.0.0.136"
|
||||
},
|
||||
"runtime": {
|
||||
|
@ -195,7 +195,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.DotNet.ILCompiler/9.0.5": {},
|
||||
"Microsoft.DotNet.ILCompiler/9.0.7": {},
|
||||
"Microsoft.Extensions.Caching.Abstractions/9.0.4": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "9.0.4"
|
||||
|
@ -349,7 +349,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.NET.ILLink.Tasks/9.0.5": {},
|
||||
"Microsoft.NET.ILLink.Tasks/9.0.7": {},
|
||||
"Microsoft.NETCore.Platforms/1.1.1": {},
|
||||
"Microsoft.NETCore.Targets/1.1.3": {},
|
||||
"Microsoft.SqlServer.Server/1.0.0": {
|
||||
|
@ -972,12 +972,12 @@
|
|||
"path": "microsoft.data.sqlclient.sni.runtime/6.0.2",
|
||||
"hashPath": "microsoft.data.sqlclient.sni.runtime.6.0.2.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.DotNet.ILCompiler/9.0.5": {
|
||||
"Microsoft.DotNet.ILCompiler/9.0.7": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-rfDodV68TLSUgVM6ZQusuUXD7GAIqwCKJWlPtfsd99iLlLbeGfqUQE7Xo8xLa1ju5GCdSBO0q35suzZ8ppclpA==",
|
||||
"path": "microsoft.dotnet.ilcompiler/9.0.5",
|
||||
"hashPath": "microsoft.dotnet.ilcompiler.9.0.5.nupkg.sha512"
|
||||
"sha512": "sha512-FpvJ2rCpj2CB/4hZt0cmB3hCPMNZV2vrisQis3hR9itTEjLzeggi0AShrgJIZ5+3Y7433K7ESSsJ6+8T+nE2nQ==",
|
||||
"path": "microsoft.dotnet.ilcompiler/9.0.7",
|
||||
"hashPath": "microsoft.dotnet.ilcompiler.9.0.7.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Caching.Abstractions/9.0.4": {
|
||||
"type": "package",
|
||||
|
@ -1077,12 +1077,12 @@
|
|||
"path": "microsoft.identitymodel.tokens/7.5.0",
|
||||
"hashPath": "microsoft.identitymodel.tokens.7.5.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.NET.ILLink.Tasks/9.0.5": {
|
||||
"Microsoft.NET.ILLink.Tasks/9.0.7": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-4L7wbb3Y4BJgIeSnmAf/C6S/qCs9rT1b0dX72uj3qo0qvUH7D0U1tU5ZlC7A3Wb8E/dXK4caOi4JkdLTVJaXhw==",
|
||||
"path": "microsoft.net.illink.tasks/9.0.5",
|
||||
"hashPath": "microsoft.net.illink.tasks.9.0.5.nupkg.sha512"
|
||||
"sha512": "sha512-SZ1brSGoLnhLbE8QUZrtN6YwzN2gDT1wbx9qDBEfFFJcstiDTjJ6ygNuTPBV/K7SjGfx2YNbcJi5+ygbPOZpDg==",
|
||||
"path": "microsoft.net.illink.tasks/9.0.7",
|
||||
"hashPath": "microsoft.net.illink.tasks.9.0.7.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.NETCore.Platforms/1.1.1": {
|
||||
"type": "package",
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -9,8 +9,8 @@
|
|||
"BlockIPAddr/1.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Data.SqlClient": "6.0.2",
|
||||
"Microsoft.DotNet.ILCompiler": "9.0.5",
|
||||
"Microsoft.NET.ILLink.Tasks": "9.0.5",
|
||||
"Microsoft.DotNet.ILCompiler": "9.0.7",
|
||||
"Microsoft.NET.ILLink.Tasks": "9.0.7",
|
||||
"kmCommonLibsCore": "2.0.0.136"
|
||||
},
|
||||
"runtime": {
|
||||
|
@ -195,7 +195,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.DotNet.ILCompiler/9.0.5": {},
|
||||
"Microsoft.DotNet.ILCompiler/9.0.7": {},
|
||||
"Microsoft.Extensions.Caching.Abstractions/9.0.4": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "9.0.4"
|
||||
|
@ -349,7 +349,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.NET.ILLink.Tasks/9.0.5": {},
|
||||
"Microsoft.NET.ILLink.Tasks/9.0.7": {},
|
||||
"Microsoft.NETCore.Platforms/1.1.1": {},
|
||||
"Microsoft.NETCore.Targets/1.1.3": {},
|
||||
"Microsoft.SqlServer.Server/1.0.0": {
|
||||
|
@ -972,12 +972,12 @@
|
|||
"path": "microsoft.data.sqlclient.sni.runtime/6.0.2",
|
||||
"hashPath": "microsoft.data.sqlclient.sni.runtime.6.0.2.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.DotNet.ILCompiler/9.0.5": {
|
||||
"Microsoft.DotNet.ILCompiler/9.0.7": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-rfDodV68TLSUgVM6ZQusuUXD7GAIqwCKJWlPtfsd99iLlLbeGfqUQE7Xo8xLa1ju5GCdSBO0q35suzZ8ppclpA==",
|
||||
"path": "microsoft.dotnet.ilcompiler/9.0.5",
|
||||
"hashPath": "microsoft.dotnet.ilcompiler.9.0.5.nupkg.sha512"
|
||||
"sha512": "sha512-FpvJ2rCpj2CB/4hZt0cmB3hCPMNZV2vrisQis3hR9itTEjLzeggi0AShrgJIZ5+3Y7433K7ESSsJ6+8T+nE2nQ==",
|
||||
"path": "microsoft.dotnet.ilcompiler/9.0.7",
|
||||
"hashPath": "microsoft.dotnet.ilcompiler.9.0.7.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Caching.Abstractions/9.0.4": {
|
||||
"type": "package",
|
||||
|
@ -1077,12 +1077,12 @@
|
|||
"path": "microsoft.identitymodel.tokens/7.5.0",
|
||||
"hashPath": "microsoft.identitymodel.tokens.7.5.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.NET.ILLink.Tasks/9.0.5": {
|
||||
"Microsoft.NET.ILLink.Tasks/9.0.7": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-4L7wbb3Y4BJgIeSnmAf/C6S/qCs9rT1b0dX72uj3qo0qvUH7D0U1tU5ZlC7A3Wb8E/dXK4caOi4JkdLTVJaXhw==",
|
||||
"path": "microsoft.net.illink.tasks/9.0.5",
|
||||
"hashPath": "microsoft.net.illink.tasks.9.0.5.nupkg.sha512"
|
||||
"sha512": "sha512-SZ1brSGoLnhLbE8QUZrtN6YwzN2gDT1wbx9qDBEfFFJcstiDTjJ6ygNuTPBV/K7SjGfx2YNbcJi5+ygbPOZpDg==",
|
||||
"path": "microsoft.net.illink.tasks/9.0.7",
|
||||
"hashPath": "microsoft.net.illink.tasks.9.0.7.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.NETCore.Platforms/1.1.1": {
|
||||
"type": "package",
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -4,7 +4,7 @@
|
|||
"includedFrameworks": [
|
||||
{
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "9.0.5"
|
||||
"version": "9.0.7"
|
||||
}
|
||||
],
|
||||
"configProperties": {
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue