public static string SendGroupMessage(string pKey, string ApiData, long ThisQQ, long GroupId, string MessageContent, bool Anonymous) { string ret = string.Empty; int privateMsgAddress = int.Parse(JObject.Parse(ApiData).SelectToken("发送群消息").ToString()); IntPtr intPtr = new IntPtr(privateMsgAddress); SendGroupMsg sendGroupmsg = (SendGroupMsg)Marshal.GetDelegateForFunctionPointer(intPtr, typeof(SendGroupMsg)); sendGroupmsg.Invoke(pKey, ThisQQ, GroupId, Marshal.StringToCoTaskMemAnsi(MessageContent), Anonymous); return(ret); }
public string SendGroupMessage(long thisQQ, long groupQQ, string msgcontent, bool anonymous = false) { string ret = string.Empty; int MsgAddress = int.Parse(JObject.Parse(jsonstr).SelectToken("发送群消息").ToString()); IntPtr intPtr = new IntPtr(MsgAddress); SendGroupMsg sendmsg = (SendGroupMsg)Marshal.GetDelegateForFunctionPointer(intPtr, typeof(SendGroupMsg)); ret = Marshal.PtrToStringAnsi(sendmsg(pluginkey, thisQQ, groupQQ, msgcontent, anonymous)); sendmsg = null; return(ret); }