110,537
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.Linq;
using RGiesecke.DllExport;//关键是这个第三方库,到底怎么搞的?
using System.Runtime.InteropService
using System.Threading;
namespace Demo
{
static class Program
{
static Int32 AuthCode;
[return: MarshalAs(UnmanagedType.LPStr)]
[DllExport()]
public static String AppInfo() {
return "9,wtf.demo.echo";
}
[DllExport()]
public static Int32 Initialize(Int32 authCode)
{
AuthCode = authCode;
return 0;
}
[DllExport()]
public static Int32 eventStartup()
{
NativeMethods.CQ_addLog(AuthCode, 10, "什么鬼", "你好,这里是木馨!");
return 0;
}
[DllExport()]
public unsafe static Int32 eventPrivateMsg(Int32 subType, Int32 sendTime, Int64 fromQQ, [MarshalAs(UnmanagedType.LPStr)] String message, Int32 font)
{
string x = message;
ThreadPool.QueueUserWorkItem(delegate(Object _)
{
NativeMethods.CQ_sendPrivateMsg(AuthCode, fromQQ, x);
});
return 0;
}
}
}