




















VB.NET:
Imports System.Runtime.InteropServices
Public Class MessageBoxVB
Public Const UserReference As String = "user32.dll"
<DllImport(UserReference)> _
Private Shared Function MessageBox(ByVal hWnd As IntPtr, ByVal pText As String, ByVal pCaption As String, ByVal uType As Int32) As Int32
End Function
End Class
C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;namespace ComVisibleCS
{
class MessageBoxCS
{
public const String UserReference = "user32.dll";
[DllImport(UserReference, SetLastError = true)]
private static extern Int32 MessageBox(IntPtr hWnd, String pText, String pCaption, Int32 uType);
}
}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。