session101
Member
- Joined
- May 10, 2006
- Messages
- 23
I have a shortcut pointing to an xls file. In my C# application, I need to launch the shortcut with Excel.
I am currently doing this:
string full_path = path;
FileInfo file = new System.IO.FileInfo(full_path);
try
{
if (file.Exists)
{
Response.Clear();
Response.AddHeader("Content-Disposition",
"attachment; filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/vnd.ms-excel";
Response.Flush();
Response.WriteFile(file.FullName);
Response.End();
}
}
This fails because the shortcut fails on the file.Exists function. How should I launch the shortcut with Excel?
TIA.
I am currently doing this:
string full_path = path;
FileInfo file = new System.IO.FileInfo(full_path);
try
{
if (file.Exists)
{
Response.Clear();
Response.AddHeader("Content-Disposition",
"attachment; filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/vnd.ms-excel";
Response.Flush();
Response.WriteFile(file.FullName);
Response.End();
}
}
This fails because the shortcut fails on the file.Exists function. How should I launch the shortcut with Excel?
TIA.