⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 include.cs

📁 为了对短消息信息应用开发商提供支持
💻 CS
字号:
using System;
using System.Runtime.InteropServices;
using System.Text;



namespace sendmessage
{
	/// <summary>
	/// include 的摘要说明。
	/// </summary>
	public class include
	{
		public include()
		{		
		}

	    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
		public	struct SmsSend
		{ 
           public int lSmsID;
			public int reserve;
           [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 24)]
           public string szMobile;
           [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 168)]
           public string szMsg;
		}

		[DllImport("user32.dll")]//获得窗口句柄的函数,第一个参数为NULL,指定对当前所有窗口都进行搜索。第二个参数就是待搜寻的窗口标题
		public static extern IntPtr FindWindow(string className,string WindowsName);

		[DllImport( "SmsSdk.dll")]//连接短信平台服务器并登录
		public static extern int  Sms_Connect(string pServer,int lCorpID,string pLoginName, string pPasswd , int lTimeOut, IntPtr hWnd );

		[DllImport( "SmsSdk.dll")]//断开短信平台服务器的连接
		public static extern int  Sms_DisConnect();

		[DllImport("SmsSdk.dll")]//发送指定的短信,它能自动分段发送,每段信息最大长度为70个字
		public static extern int   Sms_Send(string pMobile , string pMsg , out int lSmsID );

		[DllImport("SmsSdk.dll")]//发送指定的短信,它能自动分段发送,每段信息最大长度为70个字
		public static extern int   Sms_Send2(string pExNum , string pMobile , string pMsg , out int lSmsID );

		[DllImport("SmsSdk.dll")]//发送指定的短信,它能自动分段发送,每段信息最大长度为70个字
		public static extern int   Sms_SendEx(IntPtr pSmsSend , int lCount ,int bWaitRet);

		[DllImport("SmsSdk.dll")]//查询指定短信发送后的状态
		public static extern int  Sms_Status(int lSmsID); 

		[DllImport("SmsSdk.dll")]//查询本帐号能够使用的剩余短信数
		public static extern int  Sms_KYSms(); 

		[DllImport("SmsSdk.dll")]//接受短信函数
		public static extern int Sms_Get(  StringBuilder pNo,StringBuilder pMsg,StringBuilder pTime);

		[DllImport("SmsSdk.dll")]//接受短信函数
		public static extern int Sms_Get2(  StringBuilder pSendNo, StringBuilder pRecvNo,StringBuilder pMsg,StringBuilder pTime);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -