mirror of
https://github.com/netchx/netch.git
synced 2026-04-01 19:15:09 +08:00
[General] Run code cleaner
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
|
||||
@@ -1,87 +1,83 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RedirectorTester
|
||||
{
|
||||
public class RedirectorTester
|
||||
{
|
||||
public enum NameList : int
|
||||
{
|
||||
AIO_FILTERLOOPBACK,
|
||||
AIO_FILTERINTRANET,
|
||||
AIO_FILTERPARENT,
|
||||
AIO_FILTERICMP,
|
||||
AIO_FILTERTCP,
|
||||
AIO_FILTERUDP,
|
||||
AIO_FILTERDNS,
|
||||
|
||||
AIO_ICMPING,
|
||||
|
||||
AIO_DNSHOST,
|
||||
AIO_DNSPORT,
|
||||
|
||||
AIO_TGTHOST,
|
||||
AIO_TGTPORT,
|
||||
AIO_TGTUSER,
|
||||
AIO_TGTPASS,
|
||||
|
||||
AIO_CLRNAME,
|
||||
AIO_ADDNAME,
|
||||
AIO_BYPNAME
|
||||
}
|
||||
|
||||
[DllImport("Redirector.bin", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool aio_register([MarshalAs(UnmanagedType.LPWStr)] string value);
|
||||
|
||||
[DllImport("Redirector.bin", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool aio_unregister([MarshalAs(UnmanagedType.LPWStr)] string value);
|
||||
|
||||
[DllImport("Redirector.bin", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool aio_dial(NameList name, [MarshalAs(UnmanagedType.LPWStr)] string value);
|
||||
|
||||
[DllImport("Redirector.bin", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool aio_init();
|
||||
|
||||
[DllImport("Redirector.bin", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void aio_free();
|
||||
|
||||
[DllImport("Redirector.bin", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern ulong aio_getUP();
|
||||
|
||||
[DllImport("Redirector.bin", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern ulong aio_getDL();
|
||||
|
||||
public static void Main(string[] args)
|
||||
public enum NameList : int
|
||||
{
|
||||
aio_dial(NameList.AIO_FILTERLOOPBACK, "false");
|
||||
aio_dial(NameList.AIO_FILTERINTRANET, "false");
|
||||
aio_dial(NameList.AIO_FILTERPARENT, "false");
|
||||
aio_dial(NameList.AIO_FILTERICMP, "true");
|
||||
aio_dial(NameList.AIO_FILTERTCP, "true");
|
||||
aio_dial(NameList.AIO_FILTERUDP, "true");
|
||||
aio_dial(NameList.AIO_FILTERDNS, "false");
|
||||
AIO_FILTERLOOPBACK,
|
||||
AIO_FILTERINTRANET,
|
||||
AIO_FILTERPARENT,
|
||||
AIO_FILTERICMP,
|
||||
AIO_FILTERTCP,
|
||||
AIO_FILTERUDP,
|
||||
AIO_FILTERDNS,
|
||||
|
||||
aio_dial(NameList.AIO_ICMPING, "10");
|
||||
AIO_ICMPING,
|
||||
|
||||
aio_dial(NameList.AIO_DNSHOST, "1.1.1.1");
|
||||
aio_dial(NameList.AIO_DNSPORT, "53");
|
||||
AIO_DNSHOST,
|
||||
AIO_DNSPORT,
|
||||
|
||||
aio_dial(NameList.AIO_TGTHOST, "127.0.0.1");
|
||||
aio_dial(NameList.AIO_TGTPORT, "1080");
|
||||
aio_dial(NameList.AIO_TGTUSER, "");
|
||||
aio_dial(NameList.AIO_TGTPASS, "");
|
||||
AIO_TGTHOST,
|
||||
AIO_TGTPORT,
|
||||
AIO_TGTUSER,
|
||||
AIO_TGTPASS,
|
||||
|
||||
aio_dial(NameList.AIO_CLRNAME, "");
|
||||
aio_dial(NameList.AIO_ADDNAME, "Telegram");
|
||||
aio_dial(NameList.AIO_ADDNAME, "NatTypeTester");
|
||||
AIO_CLRNAME,
|
||||
AIO_ADDNAME,
|
||||
AIO_BYPNAME
|
||||
}
|
||||
|
||||
aio_init();
|
||||
Console.ReadLine();
|
||||
aio_free();
|
||||
}
|
||||
[DllImport("Redirector.bin", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool aio_register([MarshalAs(UnmanagedType.LPWStr)] string value);
|
||||
|
||||
[DllImport("Redirector.bin", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool aio_unregister([MarshalAs(UnmanagedType.LPWStr)] string value);
|
||||
|
||||
[DllImport("Redirector.bin", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool aio_dial(NameList name, [MarshalAs(UnmanagedType.LPWStr)] string value);
|
||||
|
||||
[DllImport("Redirector.bin", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool aio_init();
|
||||
|
||||
[DllImport("Redirector.bin", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void aio_free();
|
||||
|
||||
[DllImport("Redirector.bin", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern ulong aio_getUP();
|
||||
|
||||
[DllImport("Redirector.bin", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern ulong aio_getDL();
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
aio_dial(NameList.AIO_FILTERLOOPBACK, "false");
|
||||
aio_dial(NameList.AIO_FILTERINTRANET, "false");
|
||||
aio_dial(NameList.AIO_FILTERPARENT, "false");
|
||||
aio_dial(NameList.AIO_FILTERICMP, "true");
|
||||
aio_dial(NameList.AIO_FILTERTCP, "true");
|
||||
aio_dial(NameList.AIO_FILTERUDP, "true");
|
||||
aio_dial(NameList.AIO_FILTERDNS, "false");
|
||||
|
||||
aio_dial(NameList.AIO_ICMPING, "10");
|
||||
|
||||
aio_dial(NameList.AIO_DNSHOST, "1.1.1.1");
|
||||
aio_dial(NameList.AIO_DNSPORT, "53");
|
||||
|
||||
aio_dial(NameList.AIO_TGTHOST, "127.0.0.1");
|
||||
aio_dial(NameList.AIO_TGTPORT, "1080");
|
||||
aio_dial(NameList.AIO_TGTUSER, "");
|
||||
aio_dial(NameList.AIO_TGTPASS, "");
|
||||
|
||||
aio_dial(NameList.AIO_CLRNAME, "");
|
||||
aio_dial(NameList.AIO_ADDNAME, "Telegram");
|
||||
aio_dial(NameList.AIO_ADDNAME, "NatTypeTester");
|
||||
|
||||
aio_init();
|
||||
Console.ReadLine();
|
||||
aio_free();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user