hema3i
asked on
convert this vb code to c# code (win api)
hi i want to conver this code to c# code how this could be done
Private Declare Function InetIsOffline Lib "url.dll" (ByVal dwFlags As Long) As Long
Private Sub Form_Load()
'KPD-Team 2001
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
'InetIsOffline returns 0 if you're connected
MsgBox "Are you connected to the internet? " + CStr(CBool(Not (InetIsOffline(0)))), vbInformation
End Sub
Private Declare Function InetIsOffline Lib "url.dll" (ByVal dwFlags As Long) As Long
Private Sub Form_Load()
'KPD-Team 2001
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
'InetIsOffline returns 0 if you're connected
MsgBox "Are you connected to the internet? " + CStr(CBool(Not (InetIsOffline(0)))), vbInformation
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Regards
~EoinC
VB:
Private Declare Function InetIsOffline Lib "url.dll" (ByVal dwFlags As Long) As Long
C#:
using System.Runtime.interopserv
[DllImport("url.dll")]
private static extern UInt32 InetIsOffline(UInt32 dwFlags);
--------------------------
VB:
Private Sub Form_Load()
'KPD-Team 2001
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
'InetIsOffline returns 0 if you're connected
MsgBox "Are you connected to the internet? " + CStr(CBool(Not (InetIsOffline(0)))), vbInformation
End Sub
C#
private void Form1_Load(object sender, System.EventArgs e)
{
MessageBox.Show("Are You Connected to the internet?" + InetIsOffline(0).ToString(
}