Link to home
Start Free TrialLog in
Avatar of Nathan Vanderwyst
Nathan Vanderwyst

asked on

Convert VB6 MSXML2.ServerXMLHTTP process to C#

Need to convert VB6 MSXML2.ServerXMLHTTP process to C#.  I don't want to use MSXML2 so please don't provide solutions that add that DLL reference, I want the newest C# method that will replace the code below.  I have ran across links that discuss httpWebRequest & httpWebResponse but I don't know how to implement them to replace the code below.  Please help, thank you.


            
    Dim oXMLHTTP As MSXML2.ServerXMLHTTP
    Dim strURL As String
    Dim strURLFull As String
            
    strURL = "/this_server/ServerManager.srv"
    strURLFull = "http://192.168.1.1"  & strURL
    strData = "do_reboot=yes&servermanager_return_page=%2Fadmin%2Findex.shtml%3Fsel%3Dserver&servermanager_do=set_variables"
    
    oXMLHTTP.Open "POST", strURLFull, True
    oXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    oXMLHTTP.setRequestHeader "Connection", "Keep-Alive"
    oXMLHTTP.send (strData)
    
    If oXMLHTTP.readyState <> 4 Then
            oXMLHTTP.waitForResponse 3
    End If

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Nathan Vanderwyst
Nathan Vanderwyst

ASKER

That worked like a charm.  Thank you so much.