110,535
社区成员
发帖
与我相关
我的任务
分享
string dest = "public class MyApi\r\n{"+Regex.Replace(File.ReadAllText("你的文件.vb"),@"(?m)Global\s*Const\s*(\w+)\s*=\s*&H([a-fA-F0-9]+)","public const int $1 = 0x$2;")+"\r\n}";
File.WriteAllText("test.cs");
public const int MAX_CARD_NUM = 0x8;
public const int MAX_CHANNEL_NUM = 0x40;
public const int MAX_FILE_NAME_NUM = 0x40;
public const int MAX_DTMF_NUM = 0x40;
public const int MAX_FSK_NUM = 0x400;
public const int MAX_CID_NUM = 0x80;
public const int MAX_INDEX_FILE_NUM = 0x40;
public const int MAX_INDEX_BUFFER_NUM = 0x100;
public const int MAX_CONFERENCE_GROUP_NUM = 0xA;
public const int MAX_CONFERENCE_RESOURCE_NUM = 0x20;
public const int MAX_CONFERENCE_GROUP_RESOURCE_NUM = 0x6;
public const int MESSAGE_HAVE_CID_FSK = 0x0;
public const int MESSAGE_HAVE_CID_DTMF = 0x1;
public const int MESSAGE_HAVE_CID_ERROR = 0x2;
public const int MESSAGE_HAVE_DTMF = 0x3;
public const int MESSAGE_PLAY_VOICE_END = 0x4;
public const int MESSAGE_PLAY_VOICE_EXIT = 0x5;
public const int MESSAGE_RECORD_VOICE_END = 0x6;
public const int MESSAGE_RECORD_VOICE_EXIT = 0x7;
public const int MESSAGE_GENERATE_SIGNAL_END = 0x8;
public const int MESSAGE_GENERATE_SIGNAL_EXIT = 0x9;
public const int MESSAGE_GENERATE_DTMF_END = 0xA;
public const int MESSAGE_SEND_FSK_END = 0xB;
public const int MESSAGE_HAVE_DIAL_TONE = 0xC;
public const int MESSAGE_HAVE_BUSY_TONE = 0xD;
public const int MESSAGE_HAVE_BACK_TONE = 0xE;
public const int MESSAGE_HAVE_TONE_DATA = 0xF;
public const int MESSAGE_HAVE_HELLO_VOICE = 0x10;
public const int MESSAGE_HAVE_SILENCE_DATA = 0x11;
public const int MESSAGE_HAVE_TIME_OUT = 0x12;
public const int MESSAGE_HAVE_FSK_DATA = 0x13;
public const int MESSAGE_PLAY_CIRCLE_FIRST_END = 0x14;
public const int MESSAGE_PLAY_CIRCLE_SECOND_END = 0x15;
public const int MESSAGE_RECORD_CIRCLE_FIRST_END = 0x16;
public const int MESSAGE_RECORD_CIRCLE_SECOND_END = 0x17;
public const int MESSAGE_AUTO_DIAL_NO_DIAL_TONE = 0x18;
public const int MESSAGE_AUTO_DIAL_NONE_LISTEN = 0x19;
public const int MESSAGE_AUTO_DIAL_HAVE_BUSY = 0x1A;
public const int MESSAGE_AUTO_DIAL_HOOK_OFF = 0x1B;
public const int MESSAGE_HAVE_SPECIAL_SIGNAL = 0x1C;
public const int MESSAGE_HAVE_BACK_TONE_HALT = 0x1E;
public const int MESSAGE_USER_HOOK_OFF = 0x1001;
public const int MESSAGE_USER_HOOK_ON = 0x1002;
public const int MESSAGE_USER_PICK_UP = 0x1003;
public const int MESSAGE_USER_RING_END = 0x1004;
public const int MESSAGE_TRUNK_RING = 0x2000;
public const int MESSAGE_TRUNK_POLE = 0x2001;
public const int MESSAGE_TRUNK_PICK_UP_END = 0x2002;
public const int MESSAGE_RECORD_HOOK_OFF = 0x3001;
public const int MESSAGE_RECORD_HOOK_ON = 0x3002;
public const int MESSAGE_RECORD_RING = 0x3003;
public const int MESSAGE_RECORD_OPEN_CIRCLE = 0x3004;
public const int MESSAGE_RECORD_NO_OPEN_CIRCLE = 0x3005;
public const int MESSAGE_SEND_FAX_OK = 0x6000;
public const int MESSAGE_SEND_FAX_ERROR = 0x6001;
public const int MESSAGE_RECEIVE_FAX_OK = 0x6002;
public const int MESSAGE_RECEIVE_FAX_ERROR = 0x6003;
public const int MESSAGE_FAX_HAVE_REMOTE_TEL_NO = 0x6004;
public const int MESSAGE_FAX_HAVE_INFORMATION = 0x6005;
public const int MESSAGE_PLAY_SOUND_END = 0x7031;
public const int MESSAGE_PLAY_SOUND_EXIT = 0x7032;
public const int COMPRESS_TYPE_64KBPS = 0x0;
public const int COMPRESS_TYPE_32KBPS = 0x1;
public const int COMPRESS_TYPE_16KBPS = 0x2;
public const int COMPRESS_TYPE_8KBPS = 0x3;
public const int COMPRESS_TYPE_GSM = 0x4;
' Define Error const
public const int GX_OK = 0x0;
public const int GX_NO_ERROR = 0x0;
public const int GX_ERROR = 0xFFFF;
public const int GX_ERROR_LOAD_PROGRAM = 0xFFFE;
public const int GX_ERROR_OPEN_DRIVER = 0xFFFD;
public const int CHANNEL_TYPE_NONE = 0x0;
public const int CHANNEL_TYPE_USER = 0x1;
public const int CHANNEL_TYPE_TRUNK = 0x2;
public const int CHANNEL_TYPE_RECORD = 0x3;
public const int CHANNEL_TYPE_MIX = 0x4;
public const int STOP_NOT_DTMF = 0x0;
public const int STOP_ANY_DTMF = 0x1;
public const int SIGNAL_TYPE_DIAL = 0x0;
public const int SIGNAL_TYPE_BACK = 0x1;
public const int SIGNAL_TYPE_BUSY350 = 0x2;
public const int SIGNAL_TYPE_BUSY700 = 0x3;
public const int SIGNAL_TYPE_OTHER = 0x4;
public const int FAX_TYPE_BFX = 0x0;
public const int FAX_TYPE_TIF = 0x1;
public class MyWin32
{
public const int FAX_TYPE_TIF = 0x01;
//都以此类推的写
}
使用例如
MyWin32.FAX_TYPE_TIF