Open a File

dhj

Well-known member
Joined
Sep 18, 2003
Messages
82
Location
Sri Lanka
hi all
im doing a web application with .net and C#
i wanna display (open) a file (for eg word doc) onclick event of a button
this is what i wrote for open the file

File.Open(FilePath,FileMode.Open, FileAccess.Read, FileShare.Read);

FilePath is the variable which contain the file path of the file i want to open

but this is not working

can anybody help me

thank you in advance
 
You should not be using the compatibility Runtime
Code:
Open Output to a file(Create if it does not exist)
Dim S As IO.StreamWriter = New IO.StreamWriter(FilePath)
S.WriteLine("stuff") Put the word "stuff" in the file
S.Close Close the stream
 
Back
Top