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 StringByVal pCaption As StringByVal 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);
    }
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-15
  • 2021-12-20
  • 2021-04-03
  • 2022-12-23
  • 2022-12-23
  • 2021-09-11
  • 2021-07-31
相关资源
相似解决方案