加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

VB转C#重写问题

发布时间:2020-12-17 00:12:25 所属栏目:大数据 来源:网络整理
导读:我在VB中有以下方法声明,需要将其转换为C#: DllImport("winspool.Drv",EntryPoint:="OpenPrinterW",_ SetLastError:=True,CharSet:=CharSet.Unicode,_ ExactSpelling:=True,CallingConvention:=CallingConvention.StdCall) _Public Shared Function OpenPri
我在VB中有以下方法声明,需要将其转换为C#:
<DllImport("winspool.Drv",EntryPoint:="OpenPrinterW",_
   SetLastError:=True,CharSet:=CharSet.Unicode,_
   ExactSpelling:=True,CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function OpenPrinter(ByVal src As String,ByRef hPrinter As IntPtr,ByVal pd As Int16) As Boolean
End Function

特别是我不确定ByRef参数说明符是否等同于ref是C#.
另外我不知道Shared == static是否必须是extern.
可能很多人都精通VB和C#,所以我很感激在C#中提供正确的声明.

检查签名:
http://pinvoke.net/default.aspx/winspool/OpenPrinter.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读