locked
Equivalence of CreateObject("Microsoft.XMLHTTP") in c# RRS feed

  • Question

  • Hello all,

    What is the equivalence of :

    VB

    CreateObject("Microsoft.XMLHTTP")
    

    in C#

     

    Thank you,

    Wednesday, February 1, 2012 6:19 PM

Answers

  • A converter would give you a call to the exact same method VB uses:

    Interaction.CreateObject("Microsoft.XMLHTTP")
    

    You could instead use non-VB-specific classes.

    Activator.CreateInstance(Type.GetTypeFromProgID("Microsoft.XMLHTTP"))
    

    Or you could find an equivalent class to do the same work. For example HttpWebRequest.

    http://msdn.microsoft.com/en-us/magazine/cc301587.aspx
    • Edited by Louis.fr Thursday, February 2, 2012 1:40 PM
    • Proposed as answer by servy42 Thursday, February 2, 2012 3:01 PM
    • Marked as answer by elie el alam Thursday, February 2, 2012 10:54 PM
    Thursday, February 2, 2012 1:39 PM

All replies