参考
http://www.cnblogs.com/liefeng123/articles/533743.html
http://www.cnblogs.com/liefeng123/articles/533743.html
解决方案 »
- 多个分类,其中每个分类包含若干小分类的数据库应该如何划分
- c#调用cmd并获取返回信息
- 如何将xml文件封装进dll文件或者资源文件
- 问一个匹配的问题,紧急求助
- 哪个说说 .Disponse() 和 = null 的区别?
- 求一正则表达式的写法,请大家帮忙。。。。。。
- C#调用DLL,回传struct内容的格式长短定位问题!高手指教!
- 这个SyncOrderRelationReq和SyncOrderRelationResp有什么问题啊,本人第一次接触,寻求解决方法啊。多谢啊
- 无法显示label?急!!!
- 如何获得像资源管理器上的桌面上的我的电脑,网上邻居等等
- c#写的播放数据流怎么会有杂音?????请各位大侠指点
- 怎么捕获邮件的异常(NO SUCH User) 最后的30分
------------
这句是不对的哦~
http://www.cnblogs.com/panjun-Donet/archive/2008/08/01/1258312.html
http://topic.csdn.net/u/20070716/20/d0273e40-9dbd-47dd-ab39-e92d1b1d024a.html
http://topic.csdn.net/t/20060604/16/4799496.html
msdn查的...不要在意说法啦...
看来唯一的办法是写个C++类封装一下了。
Anyway,谢谢各位!
[System.Runtime.InteropServices.DllImportAttribute("<Unknown>", EntryPoint="SCardListReadersW")]
public static extern int SCardListReadersW(uint hContext, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPWStr)] string mszGroups, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPWStr)] System.Text.StringBuilder mszReaders, ref uint pcchReaders) ;string:
[System.Runtime.InteropServices.DllImportAttribute("<Unknown>", EntryPoint="SCardListReadersW")]
public static extern int SCardListReadersW(uint hContext, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPWStr)] string mszGroups,
[System.Runtime.InteropServices.OutAttribute()][System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPWStr)] string mszReaders, ref uint pcchReaders) ;"<Unknown>", 换成你的DLL希望对你有用。
对应StringBuilder,String,Byte[],char[]都行,后两者在知道长度的情况下是没问题的,你这没有,但应该也行,写法如下:StringBuilder:
[DllImport("<Unknown>", EntryPoint="SCardListReadersW")]
public static extern int SCardListReadersW(uint hContext, [In,MarshalAs(UnmanagedType.LPWStr)] string mszGroups, [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder mszReaders, ref uint pcchReaders) ;string:
[DllImport("<Unknown>", EntryPoint="SCardListReadersW")]
public static extern int SCardListReadersW(uint hContext, [In, MarshalAs(UnmanagedType.LPWStr)] string mszGroups,
[Out,MarshalAs(UnmanagedType.LPWStr)]string mszReaders, ref uint pcchReaders) ;"<Unknown>", 换成你的DLL
In,可以省略希望对你有用。