The network path was not found

1

At the moment of giving click in the listbox where it shows me the IP address where the folder is located and see the comments that it has, it throws me the following:

  

IOException The network path was not found

The address I enter is correct and if it opens in the browser. My question is: Why is not the content shown?

The image shows the address that is \10.49.127.12\CM_Users\Oscar Guerrero\projects\SAP Files%code% here are the folders that I want to see in comments

    
asked by Elizabeth Flores Perez 04.07.2017 в 20:04
source

2 answers

1

The txtDelivery.Text should be enclosed in single quotes to let the String know that this data is a text string (even if they are numbers).

It would stay:

Dim Destino as String = "\10.49.127.12\CM_Users\Oscar Guerrero\Projects\SAP Files
Dim Destino as String = "\10.49.127.12\CM_Users\Oscar Guerrero\Projects\SAP Files%pre%'" + txtDelivery.Text + "'.txt"
'" + txtDelivery.Text + "'.txt"
    
answered by 05.07.2017 в 15:45
0

The problem you have is that you are not connecting to that computer with a username and password, then when connecting without a user, it fails and you get the error message, even if the shared folder is public.

You must establish a connection with that route indicating a username and a password:

For this we will use command line, and we will do it with NET USE:

Dim pcs As New ProcessStartInfo("cmd.exe")
Dim command As String = "NET USE " + Ubicacion + " /user:" + username + " " + password
pcs.Arguments = command
Process.Start(pcs)
command = " copy \"" + filePath + "\"  \"" + directory + filenameToSave + "\""
pcs.Arguments = command
Process.Start(pcs)

I hope it serves you.

    
answered by 05.07.2017 в 10:16