We have several thousand PDF files on a network folder //myserver/pdffiles/
I have a VB.NET application that has a button on it that the user will click and it opens up one of the PDF files.
Users do not have security over the folder or pdf files.
My network people created me a username which does have access to all of the files, I thought I could impersonate that user in the code to open the file. I get an error from adobe when I do this. “An internal error occurred.”
I have tested the username/login peice by using a different password and I end up with an error message that tells me its wrong.
I have also tested opening a local copy of a pdf file without the username/password in the process and it opens fine.
I am currently on Windows 7 and coding with Visual Studio 2010.
This application will primarly run on Windows XP Pro (only a couple Win 7) machines on our internal network.
Here is the code I am using.
Dim readerPath As String = Registry.GetValue( _
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AcroRd32.exe" & "AcroRd32.exe", _
"Path", "Key does not exist")
Dim strDrawingName As String
strDrawingName = "\\myserver\pdffiles\Cost_Test.pdf"
Dim startInfo As New ProcessStartInfo
startInfo.FileName = readerPath
startInfo.Arguments = strDrawingName
startInfo.UserName() = "PDFAdmin"
startInfo.Password = New System.Security.SecureString()
For Each c As Char In "adminpassword"
startInfo.UseShellExecute = False