Problems with UNC

G

glbdev

Hi.

I am having 2 problems ... both involve using a UNC path.

The first problem is that I am using an image control and the imageURL
needs to be dynamically obtained. My code is: Me.imgLogo.ImageUrl = "\
\myserver\\filedirectory\file.gif". Unfortunately, this hangs and
does not show the image.

The second problem is that I want to create a directory on a remote
machine (if it doesn't exist), and copy a file to it. The file name
has a UNC such as "\\myserver\remotepath\myfile.txt". This code is:

Dim DstFileInfo As New FileInfo(sRemotePath)

If DstFileInfo.Directory.Exists = False Then
Try
DstFileInfo.Directory.Create()
Catch ex As Exception
Console.WriteLine("Error creating directory: " + sRemotePath)
Return False
End Try
End If

Dim CopyToPathFileInfo As New IO.FileInfo(sFileNameLocal)
CopyToPathFileInfo.CopyTo(sRemotePath.ToString.Trim, True)

This returns no error, it just hangs.

Does anyone have any info as to why this is happening? The share
permissions are set on the remote.

Thanks,
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top