none
Command Button To Open Network Location RRS feed

  • Question

  • Hi All,

    I have tried searching multiple forums for this answer and cannot something so i thought i'd pose the questions.

    I am working on making a Hub for information for my colleagues at work and would like to use a command button so that when they click it, it opens a networked folder which i have set up. Is there a specific code i would be able to use? The only ones i can find are for local folders, which from my attempts do not work when a networked location is put in.

    My knowledge with Visual Basic is limited and self taught so please be nice.

    Many thanks in advance

    Thursday, April 18, 2019 11:30 AM

All replies

  • Hello,

    All you need to do is use Process.Start eg. Process.Start("H:\Data"), replace H:\Data with your network folder name. 

    Dim folderName As String = "H:\Data"
    If File.Exists(folderName) Then
        Process.Start(folderName)
    Else
        '
        ' They don't have permissions to the folder etc.
        '
    End If


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, April 18, 2019 11:39 AM
    Moderator
  • Thank you. I however went for a simple route of using a hyper link which for some reason i hadnt thought about.
    Thursday, April 18, 2019 12:20 PM
  • Thank you. I however went for a simple route of using a hyper link which for some reason i hadnt thought about.
    For a hyper link use a LinkLabel, place useful text in the label.Text property, create a Click event then in the Click event do Process.Start(someLinkedLabek.Text) or if the Text is not the link place the appropriate information into Process.Start. 

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, April 18, 2019 1:17 PM
    Moderator