hello,
I am Anas Siddiqui, i am developing a text editor and it works properly. and its files are open very easily by open file dialog. but when i am click directly its file icon to open that file, the file opens in my text editor by the content of my file is not loaded.......
Loading
CrishPosted Apr 9, 2011, 5:20 AM
The Example is solution of icon click.
string fileName = "text.txt";
string filePath = Server.MapPath("~/" + fileName);
Response.Clear();
Response.AppendHeader("content-disposition", "attachment; filename=" + fileName);
Response.ContentType = "application/octet-stream";
Response.WriteFile(filePath);
Response.Flush();
Response.End();
Sam HobbsPosted Apr 9, 2011, 1:09 AM
FroglegPosted Apr 9, 2011, 1:04 AM
When i read your post I rechecked the application and it worked Ok, so I was at a loss with your problem
By the way it's gonna rain today
Sam HobbsPosted Apr 8, 2011, 10:51 PM
What happened? Nothing! Why did nothing happen? Because the build saw that the date on the exe is past the date of the code modification. Got it? It is a timezone thing. I said "I happen to be about 19 hours behind you". Got it? The exe in your zip file that you built had a file date that was in the future for me at the moment I modified the code. So I am just having a bit of fun here; I hope you enjoy the humor. Seriously, though, there might be someone in the future that might not be so quick to catch on. It's not big problem and a simple quick rebuild all solves the problem but some people might be confused.
FroglegPosted Apr 8, 2011, 7:51 PM
Sam HobbsPosted Apr 8, 2011, 7:47 PM
FroglegPosted Apr 8, 2011, 7:23 PM
You will have to check the file type to make sure it is a text file
Sam HobbsPosted Apr 8, 2011, 4:25 PM
Are you processing the arguments in the command line? If you don't know what that is then I assume your program is not doing that. Try doing this. In the Program.cs file add "string[] args" to the Main so it looks like:
static void Main(string[] args)
Then (just for test purposes) add the following lines to the beginning of Main:if (args.Length > 0)
MessageBox.Show(args[0]);
Then open a file by "click directly its file icon to open that file". If that executers the modified version then you should see the filename in the message box. There will probably be something more but I am not sure. So then look for articles and such about hows to process the command line.
Suthish NairPosted Apr 8, 2011, 12:09 PM