diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..1d3614d --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,26 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + "program": "${workspaceFolder}/bin/Debug/net8.0/resequence_pgsql.dll", + "args": [ + "-ip:192.168.0.108", + "-u:mcarman", + "-pwd:@ng31F@rm0823262", + "-lip:127.0.0.1", + "-p:5432", + "-db:accessdb_v3" + ], + "cwd": "${workspaceFolder}", + "stopAtEntry": false, + "console": "internalConsole" + } + ] +} diff --git a/ArgHelper.cs b/ArgHelper.cs index 16ff806..2acbf5f 100644 --- a/ArgHelper.cs +++ b/ArgHelper.cs @@ -31,11 +31,11 @@ namespace resequence_pgsql } public class ArgSimple { - public string ip { get; set; } - public string un { get; set; } - public string pwd { get; set; } - public string lip { get; set; } - public int port { get; set; } - public string db { get; set; } + public string ip { get; set; } = string.Empty; + public string un { get; set; } = string.Empty; + public string pwd { get; set; } = string.Empty; + public string lip { get; set; } = string.Empty; + public int? port { get; set; } = null; + public string db { get; set; } = string.Empty; } } \ No newline at end of file diff --git a/Program.cs b/Program.cs index 634e09b..18ea787 100644 --- a/Program.cs +++ b/Program.cs @@ -12,7 +12,7 @@ if (args.Length == 0) else { ArgSimple arg = ArgHelper.GetArgs(args); - using (PGHelper pg = new PGHelper(arg.ip, arg.un, arg.pwd, arg.lip, arg.port, arg.db)) + using (PGHelper pg = new PGHelper(arg.ip, arg.un, arg.pwd, arg.lip, Convert.ToInt32(arg.port), arg.db)) { pg.ResequenceTables(); }