📄 ws2interop.cs
字号:
#region Using directives
using System;
using System.Text;
using System.Runtime.InteropServices;
using System.Collections;
#endregion
namespace BTHWrapper
{
/// <summary>
/// Summary description for Ws2Interop.
/// </summary>
public class Ws2Interop
{
[DllImport("bthutil", SetLastError = true)]
public extern static Int32 BthSetMode(int dwMode);
[DllImport("bthutil", SetLastError = true)]
public extern static Int32 BthGetMode(IntPtr pdwMode);
[DllImport("Ws2_32", SetLastError = true, EntryPoint = "WSAStartup",CharSet = CharSet.Auto)]
public extern static Int32 WSAStartup([In] short wVersionRequested, [Out] out Ws2Structs.WSAData wsaData);
[DllImport("Ws2", SetLastError = true)]
public extern static Int32 WSACleanup();
[DllImport("ws2", SetLastError = true)]
public extern static IntPtr socket(int family, int type, int protocol);
[DllImport("Ws2", SetLastError = true)]
public extern static int shutdown(IntPtr socket,int how);
[DllImport("Ws2", SetLastError = true)]
public extern static int closesocket(IntPtr socket);
[DllImport("Ws2", SetLastError = true)]
public extern static int connect(IntPtr socket, ref Ws2Structs.SOCKADDR_BTH address, int addressSize);
[DllImport("Ws2", SetLastError = true)]
public extern static int send(IntPtr socket, byte[] buffer, int len, int flags);
[DllImport("Ws2", SetLastError = true)]
public extern static int recv(IntPtr socket, byte[] buffer, int len, int flags);
[DllImport("Ws2", SetLastError = true)]
public extern static int WSAGetLastError();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -