I am trying to open a file, e.g. a text, .doc or .mpp file, when it runs on the localhost system opens a respective file, but when installed in the IIS 5.1 and IIS 6.0 as a virtual directory, and access the file, system doesn't opens...................................................
Imports
System.IOImports
System.DiagnosticsPartial
Class CR Inherits System.Web.UI.Page Dim projectPath As String Dim documentPath As StringProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
documentPath = "Change Requests\"
projectPath = ConfigurationManager.AppSettings(
"projectDocumentPath") & Request.QueryString("pid") & "\" Dim directory As DirectoryInfodirectory =
New DirectoryInfo(projectPath & documentPath) If directory.Exists() Then Dim files As Arrayfiles = directory.GetFiles()
Dim index As Integerindex = 0
If files.Length > 0 Then Dim file As FileInfo Dim tCell As TableCell Dim tRow As TableRow Dim documentLink As LinkButton Dim aLink As HyperLink Do While index < files.LengthtRow =
New TableRowtCell =
New TableCellfile = files(index)
'aLink = New HyperLink 'aLink.NavigateUrl = projectPath & documentPath & file.Name 'aLink.ID = "A" & index 'aLink.Text = file.Name ''AddHandler aLink.PreRender, AddressOf OpenDocument 'tCell.Controls.Add(aLink)documentLink =
New LinkButtondocumentLink.ID =
"d" & indexdocumentLink.Text = file.Name
'documentLink.ResolveUrl(projectPath & documentPath & file.Name) 'documentLink.PostBackUrl = projectPath & documentPath & file.Name AddHandler documentLink.Click, AddressOf OpenDocumenttCell.Controls.Add(documentLink)
tRow.Cells.Add(tCell)
itemsTable.Rows.Add(tRow)
index = index + 1
Loop ElseEnd If End If End Sub Public Sub OpenDocument(ByVal sender As Object, ByVal e As System.EventArgs) Dim fName As String = projectPath & documentPath & sender.text
Process.Start(fName)
End Sub
end class

Opening the file as a New Process
Son
Hello !!
In IIS->Directory->properties
Virtual Directory Tab
Execute Permission : Scripts and Excutables
Application Protection: Low(IIS Process)
in Directory Security TAB
Authentication Control:
Integrated Windoes authentication
in the physical folder;
everyone has all the right, also inculded the ASPNET
-------------------------------------------
is there another way to call the process.
I was browsing the Blog... it says @"file-name"
but this doesn't work with VB, works as C#, if that is the solution, How to handle in VB
thanks..............
Smitha
corradMSDN
abid1pak
Maybe rebuild the page on a new address, but piece by piece until you discover when it fails...good luck.
quicksilverm26
Dan Jones MSFT
"C:\test\it.txt"
change it to
"C:\\test\\it.txt"
TedWagner
martan
when run as a local host as show in the link below the same function works
http://localhost:4080/DashboardDev/CR.aspx pid=S303
and when used at a server address ,,,,doesn;t
http://atuedmpc236504/testait/CR.aspx pid=S303
there the same application is deployed as a virtual directory(testait) in IIS doesn't work.
Killjoyrules
You can check the directory permissions, IE granting ASP.NET process access in the file explorer, properties ->Security tab. Good Luck.