diff --git a/NetTunnelApp/Form1.cs b/NetTunnelApp/Form1.cs
deleted file mode 100644
index 4f7e96c..0000000
--- a/NetTunnelApp/Form1.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace NetTunnelApp
-{
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/NetTunnelApp/Form1.Designer.cs b/NetTunnelApp/MainForm.Designer.cs
similarity index 77%
rename from NetTunnelApp/Form1.Designer.cs
rename to NetTunnelApp/MainForm.Designer.cs
index 76cd7e1..178487f 100644
--- a/NetTunnelApp/Form1.Designer.cs
+++ b/NetTunnelApp/MainForm.Designer.cs
@@ -1,6 +1,6 @@
namespace NetTunnelApp
{
- partial class Form1
+ partial class MainForm
{
///
/// 必需的设计器变量。
@@ -28,10 +28,17 @@
///
private void InitializeComponent()
{
- this.components = new System.ComponentModel.Container();
+ this.SuspendLayout();
+ //
+ // MainForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
- this.Text = "Form1";
+ this.Name = "MainForm";
+ this.Text = "NetTunnelApp";
+ this.ResumeLayout(false);
+
}
#endregion
diff --git a/NetTunnelApp/MainForm.cs b/NetTunnelApp/MainForm.cs
new file mode 100644
index 0000000..11beb93
--- /dev/null
+++ b/NetTunnelApp/MainForm.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace NetTunnelApp
+{
+ public partial class MainForm : Form
+ {
+ public MainForm()
+ {
+ InitializeComponent();
+
+ NetTunnelLib.TunnelSDKInitEnv();
+
+ string path = System.Environment.CurrentDirectory + "\\tunnelsdk_" +
+ string.Format("{0:yyyyMMdd_HHmm}", System.DateTime.Now) + ".log";
+ NetTunnelLib.InitTunnelSDKLog(path, LogLevel.LOG_DEBUG);
+ }
+ }
+}
diff --git a/NetTunnelApp/MainForm.resx b/NetTunnelApp/MainForm.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/NetTunnelApp/MainForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/NetTunnelApp/NetTunnelApp.csproj b/NetTunnelApp/NetTunnelApp.csproj
index 0f5a361..308486f 100644
--- a/NetTunnelApp/NetTunnelApp.csproj
+++ b/NetTunnelApp/NetTunnelApp.csproj
@@ -12,9 +12,10 @@
512
true
true
+ latest
- AnyCPU
+ x64
true
full
false
@@ -22,6 +23,7 @@
DEBUG;TRACE
prompt
4
+ false
AnyCPU
@@ -36,7 +38,7 @@
LocalIntranet
- true
+ false
Properties\app.manifest
@@ -55,14 +57,18 @@
-
+
Form
-
- Form1.cs
+
+ MainForm.cs
+
+
+ MainForm.cs
+
ResXFileCodeGenerator
Resources.Designer.cs
@@ -87,4 +93,7 @@
+
+ copy /y $(SolutionDir)x64\$(ConfigurationName)\*.dll $(TargetDir)
+
\ No newline at end of file
diff --git a/NetTunnelApp/NetTunnelLib.cs b/NetTunnelApp/NetTunnelLib.cs
new file mode 100644
index 0000000..6728833
--- /dev/null
+++ b/NetTunnelApp/NetTunnelLib.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace NetTunnelApp;
+
+public enum ProtoCryptoType
+{
+ CRYPTO_NONE = 0,
+ CRYPTO_BASE64 = 1,
+ CRYPTO_AES128 = 2,
+ CRYPTO_3DES = 3,
+ CRYPTO_AES256 = 4
+}
+
+public enum LogLevel
+{
+ LOG_DEBUG = 0,
+ LOG_INFO = 1,
+ LOG_WARN = 2,
+ LOG_ERROR = 3
+}
+
+public class NetTunnelLib
+{
+ [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int CreateTunnel(String lpszMsg);
+
+ [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)]
+ internal static extern IntPtr TestMessage();
+
+ [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)]
+ internal static extern Int32 Add(int a, int b);
+
+ [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int TunnelSDKInitEnv();
+
+ [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int SetProtocolEncryptType(ProtoCryptoType type, String pProKey);
+
+ [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void InitTunnelSDKLog(String pProKey, LogLevel level);
+}
\ No newline at end of file
diff --git a/NetTunnelApp/Program.cs b/NetTunnelApp/Program.cs
index 7356590..cc09e06 100644
--- a/NetTunnelApp/Program.cs
+++ b/NetTunnelApp/Program.cs
@@ -16,7 +16,7 @@ namespace NetTunnelApp
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new Form1());
+ Application.Run(new MainForm());
}
}
}
diff --git a/NetTunnelApp/Properties/app.manifest b/NetTunnelApp/Properties/app.manifest
index e8f334c..cb3e0ea 100644
--- a/NetTunnelApp/Properties/app.manifest
+++ b/NetTunnelApp/Properties/app.manifest
@@ -16,11 +16,12 @@
如果你的应用程序需要此虚拟化来实现向后兼容性,则移除此
元素。
-->
+
-
+
diff --git a/tunnel_windows.sln b/tunnel_windows.sln
index 216dc8f..f21ca20 100644
--- a/tunnel_windows.sln
+++ b/tunnel_windows.sln
@@ -6,6 +6,9 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetTunnelSDK", "NetTunnelSDK\NetTunnelSDK.vcxproj", "{1584BAD4-DBEC-43D2-BC06-08C23F02489A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetTunnelApp", "NetTunnelApp\NetTunnelApp.csproj", "{79995848-FD05-46F5-A7FE-46265E540E32}"
+ ProjectSection(ProjectDependencies) = postProject
+ {1584BAD4-DBEC-43D2-BC06-08C23F02489A} = {1584BAD4-DBEC-43D2-BC06-08C23F02489A}
+ EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution