是否有 WinInet 的 .Net 包装器

Is there a .Net wrapper for WinInet

我想知道是否有 winInet 的 .NET 包装器给我托管代码。我知道 directx and openGl 之类的 .NET 包装器。对于我的新工作,winInet 非常重要,但是我对 win32 api 或 C++ 了解不多。

我看了看this post,但没完全明白我在找什么。

This post 这里更接近,但 link 似乎不起作用。

您可以使用该语法(仅作为示例):

<DllImport("wininet.dll")> _
Public Function InternetGetConnectedState(ByRef description As Integer, Reserved As Integer) As Boolean
End Function

因此,在您的代码中,您只需调用:

If InternetGetConnectedState(0,0) = true

看,这只是您必须执行的操作的示例。 祝你好运