Hi
From my aspx page i am calling one of the console.exe. that exe will copy
the file from network to local webserver. everything hardcoded path. I given
all the permission to that exe. I am getting below error on last line
what am i doing wrong here.
Could not find file "\\laptop02\temp\test.pdf".
thanks
bala
Exe code:
Dim Targetpath As String
Dim sourcepath As String
For Each Arg As String In Args
sourcepath = Arg
Next Arg
sourcepath = "\\laptop02\temp\test.pdf"
Targetpath = "c:\inetpub\wwwroot\temp\"
Dim myFile As FileInfo
Dim myCopiedFile As FileInfo
'check if file exists, if so delete it
If File.Exists(Path:=Targetpath & Path.GetFileName(sourcepath)) Then
File.Delete(Path:=Targetpath & Path.GetFileName(sourcepath))
End If
'get the newly created file
myFile = New FileInfo(fileName:=sourcepath)
Console.WriteLine(sourcepath)
Console.WriteLine(Targetpath)
'overwrite an existing file if need be
myCopiedFile = myFile.CopyTo(destFileName:=Targetpath &
Path.GetFileName(sourcepath), overwrite:=True)