Jump to content
Xtreme .Net Talk

session101

Members
  • Posts

    23
  • Joined

  • Last visited

session101's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I created a config with the location of my xml file: <add key="positionXML" value = "C:temp\PositionMsg.xml" /> When I try to load the xml file into my C# code, I am doing the following: XmlDocument objDoc=new XmlDocument(); objDoc.LoadXml(ConfigurationSettings.AppSettings["positionXML"]); What should I do to load the XML file and get the data elements in the XML? TIA.
  2. The file is on a shareable folder of a server. What is the best way to launch it?
  3. They are trying to access the same file that the app downloads locally onto their local machine. This is scenario may help: 1.) One User opens xls file on local machine. 2.) Another user clicks button on application to open same xls file - App downloads xls file to local temporary files folder of local machine 3.) App does not load file because of this error "fiel is used by another process" - This occurs when I try to WriteFile()
  4. I have a web app that I download file via the browser using this code: 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 works fine when the file is not opened by someone; otherwise, if a user has the file open on his machine, the web app will not launch the writefile function stating "file is used by another process". Is there a way to launch the file in read-only even though the file is already launched on a local client pc? TIA.
  5. Upon clicking a button, I would like to launch a shortcut file that is pointing to an Excel xls sheet.
  6. 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.
  7. I use a user id and password in my web.config. I do not want the password to be plain text, and would like to encrypt it. I know you can use the ASP.NET_setreg encryption exe to encrypt it in the registry. However, is there a way to input the username and password in my C# .cs file and apss this into the web.config? TIA.
  8. Ah ha! My app wasn't working correctly because it could not find a network path. Thanks for your help!
  9. I have it pointed to 1.1.4322, but it still doesn't work. It is very odd.
  10. Yes, I have .NET 1.1 installed. However, I am still having the same issues. Any ideas? TIA.
  11. The web server currently has .NET 2.0. I created my project with .NET 2003 so I need .NET 1.1. I assumed that 2.0 would have everything. Do I need to remove 2.0 first, then install 1.1 and reinstall 2.0?
  12. I have a ASP.NET web application written in C#. THe events (buttons, dropdown) worked when I had my machine as the webhost; however, when I deployed the web app to the web server, none of the events are working. My dropdown list is not being populated nor are my buttons working. When I try to click a button, I get this in the URL: http://webserver.page.aspx?__EVENTTARGET=&__EVENTARGUMENT=&__LASTFOCUS=&__VIEWSTATE=%2FwEPDwUKLTc3MzM4NTUwNQ9kFgICAQ9kFgQCAQ8QZA8WAWYWARBlZWcWAWZkAgQPEGQPFgFmFgEQZWVnFgFmZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQUMSW1hZ2VCdXR0b24x&DropDownList1=&DropDownList2=&Button1=Approved+Master+Bond+List&__EVENTVALIDATION=%2FwEWCALtgbbgCwKd5I%2FlCgKd5I%2FlCgK7q7GGCAKe5I%2FlCgKe5I%2FlCgKM54rGBgLSwpnTCA%3D%3D Any thoughts? TIA.
  13. I have an ASP.NET web app using C# as the language and am acquiring all the xls files in the list of subdirectories under the main root directory. My problem is I need to go to a server share where I need to pass in user authentication. I need to give the username, password, and domain before I go to the directory. How should I pass in my login information for the directory?
  14. I was trying to avoid putting in the blank entry, but I'll do it. Thanks!!!
  15. I have a web app that opens the appropriate application based on the file extension using Response.ContentType. When I open an xls file, I would like the file to be opened in read-only permissions with Excel. How would I do this? Here is my existing code: switch (file.Extension) { case ".pdf": Response.ContentType = "application/pdf"; break; case ".htm": case ".html": Response.ContentType = "text/html"; break; case ".txt": Response.ContentType = "text/plain"; break; case ".doc": Response.ContentType = "application/msword"; break; case ".xls": case ".csv": Response.ContentType = "application/xls"; break; default: Response.ContentType = "application/unknown"; break; } Response.Flush(); Response.WriteFile(file.FullName); Response.End(); TIA.
×
×
  • Create New...