Problems with UNC
am 20.01.2008 22:38:51 von glbdevHi.
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