none
Converting script from vbs to c# RRS feed

  • Question

  • I have the following written in vbs. i have a challenge to convert it into code c#. i am a newbie in scripting.

    Have you any idea please?


    '###FONCTION###
    Function Objet_XMLHTTP
    'On Error Resume Next
    Set Objet_XMLHTTP=CreateObject("Microsoft.XMLHTTP")
    Set Objet_XMLHTTP=CreateObject("MSXML2.XMLHTTP")
    On Error GoTo 0
    End Function


    Sub Importer_Fichier_Du_Web(source,destination)
    Set HTTP=Objet_XMLHTTP
    With HTTP
    .Open "GET",source,False
    .Send
    End With

    With CreateObject("ADODB.Stream")
    .Type=1
    .Open
    .Write HTTP.ResponseBody
    .SaveToFile destination,2
    End With


    End Sub


    Importer_Fichier_Du_Web "https://data.net/explore/dataset/data/download/", "C:\Users\SCRIPT\data.csv"

    • Moved by Bill_Stewart Friday, March 15, 2019 6:51 PM This is not "translate code into a different language for me" forum
    Wednesday, January 30, 2019 4:45 PM

All replies

  • This forum is for scripting help rather than scripting requests. We also won't help with your homework.

    Please attempt to learn the technology before using it :)

    Wednesday, January 30, 2019 4:51 PM
  • help Invoke-WebRequest -online

    or

    help Invoke-WebMethod -online


    \_(ツ)_/

    Wednesday, January 30, 2019 5:28 PM