Hello everyone,
I have a web page which needs to open files of type .pdf (adobe) and
.doc(microsoft word).
I tried something fairly simple and have been having a lot of trouble
getting it to work.
So far just started with PDF as I figured that would be the simpler of the
two. However when that didnt seem to work.. I used a simple txt file.
Here is what I am doing
Imports System.Diagnostic
Imports System.Threading
Dim mprocess as New Process
mprocess.StartInfo.FileName = "C:\temp\readme.txt"
mprocess.Start()
mprocess.WaitForInputIdle()
Thread.Sleep(1000)
What I am expecting is to see my txt file opened up. What actually happens
is..I see notepad.exe as a process in my task manager with username ASPNET
but I do not see my file opened up...
What am I missing'
Any help and sample code in this matter would be appreciated.
Thanks in advance...
..Nishaa processes started by a service, lisk asp.net do not have access to the
desktop, so they can nott open a window. you shoudl only run commandline
programs.
-- bruce (sqlwork.com)
"Nisha" <nisha.lalvani@.rogers.com> wrote in message
news:CY2dndYOFaGolT7enZ2dnUVZ_t2dnZ2d@.ro
gers.com...
> Hello everyone,
> I have a web page which needs to open files of type .pdf (adobe) and
> .doc(microsoft word).
> I tried something fairly simple and have been having a lot of trouble
> getting it to work.
> So far just started with PDF as I figured that would be the simpler of the
> two. However when that didnt seem to work.. I used a simple txt file.
> Here is what I am doing
> Imports System.Diagnostic
> Imports System.Threading
> Dim mprocess as New Process
> mprocess.StartInfo.FileName = "C:\temp\readme.txt"
> mprocess.Start()
> mprocess.WaitForInputIdle()
> Thread.Sleep(1000)
>
> What I am expecting is to see my txt file opened up. What actually happens
> is..I see notepad.exe as a process in my task manager with username ASPNET
> but I do not see my file opened up...
> What am I missing'
> Any help and sample code in this matter would be appreciated.
>
> Thanks in advance...
> ..Nisha
>
Besides Bruce's reply, Consider this:
Even you can open a "*doc" or "*.pdf" by your server app, do you really
want to open a PDF file (by Adobe Reader) on the server and have it
WaitForInputIlde? Who is going to the server room (may be located thousands
miles away from the user, or in a locked server closet/room in your company)
to read it and close it. You propbaly meant to get a PDF/doc file and send
the end user and have it open inside a web browser, rather than opeing it on
the server.
"Nisha" <nisha.lalvani@.rogers.com> wrote in message
news:CY2dndYOFaGolT7enZ2dnUVZ_t2dnZ2d@.ro
gers.com...
> Hello everyone,
> I have a web page which needs to open files of type .pdf (adobe) and
> .doc(microsoft word).
> I tried something fairly simple and have been having a lot of trouble
> getting it to work.
> So far just started with PDF as I figured that would be the simpler of the
> two. However when that didnt seem to work.. I used a simple txt file.
> Here is what I am doing
> Imports System.Diagnostic
> Imports System.Threading
> Dim mprocess as New Process
> mprocess.StartInfo.FileName = "C:\temp\readme.txt"
> mprocess.Start()
> mprocess.WaitForInputIdle()
> Thread.Sleep(1000)
>
> What I am expecting is to see my txt file opened up. What actually happens
> is..I see notepad.exe as a process in my task manager with username ASPNET
> but I do not see my file opened up...
> What am I missing'
> Any help and sample code in this matter would be appreciated.
>
> Thanks in advance...
> ..Nisha
>
0 comments:
Post a Comment