none
Use of Downloadfile and DlgOuvrit.InitialDirectorywith Visual Basic 2010 RRS feed

  • Question

  • I use 2 functions with Visual Basic 2010, which did nit seelm to react properly :

    1 - Function DownloadFile

    My.Computer.Network.DownloadFile(Web Directory/Test1.txt , "Local directory\test1.txt", "UserName", "UserCode")

    I am getting an almost empty file in C:/UBridge/

           

    2 - Function DlgOuvrir 

    dlgOuvrir = New OpenFileDialog()

    dlgOuvrir.ShowDialog()      

    dlgOuvrir.InitialDirectory = "C:/UBridge/"

    For Each Me.Nom_Fichier In dlgOuvrir.FileNames

    Label164.Text = Nom_Fichier

    Next

    The function DlgOuvrir works properly, but it is not pointing at the right directory ????

    Friday, December 21, 2018 3:16 PM

Answers

  • Hi

    2. Try this:

        Dim dlgOuvrir As New OpenFileDialog()
        dlgOuvrir.InitialDirectory = "C:/UBridge/"
        dlgOuvrir.ShowDialog()
    


    Regards Les, Livingston, Scotland

    • Marked as answer by Bernard Glorie Thursday, January 10, 2019 4:54 PM
    Friday, December 21, 2018 4:00 PM

All replies

  • Hi

    2. Try this:

        Dim dlgOuvrir As New OpenFileDialog()
        dlgOuvrir.InitialDirectory = "C:/UBridge/"
        dlgOuvrir.ShowDialog()
    


    Regards Les, Livingston, Scotland

    • Marked as answer by Bernard Glorie Thursday, January 10, 2019 4:54 PM
    Friday, December 21, 2018 4:00 PM
  • Hi,

    fix the code:

    dlgOuvrir.InitialDirectory = "C:\UBridge\"

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 24, 2018 5:25 AM
  • IT works fine now, as the line initial Directory should be before te line showdialog

    Thanks a lot

    Thursday, January 10, 2019 4:56 PM