السلام عليكم ورحمه الله وبركاته
لدي مشكله و اريد حلها و التي هي انني اريد افتح ملف موجود لدي في مسار معين عند الضغط على زر معين و ان يكون هناك خيار عند الفتح للملف ام بالحفظ على الجهاز او فتحه فقط.
فما العمل ....
السلام عليكم ورحمه الله وبركاته
لدي مشكله و اريد حلها و التي هي انني اريد افتح ملف موجود لدي في مسار معين عند الضغط على زر معين و ان يكون هناك خيار عند الفتح للملف ام بالحفظ على الجهاز او فتحه فقط.
فما العمل ....
If you have an apple and I have an apple and we exchange these apples then you and I will still each have one apple. But if you have an idea and I have an idea and we exchange these ideas, then each of us will have two ideas.
ابشركم وجدت الحل و لانني اردت ان يستفيد الجميع منه فقد وضعتة
string fileName = "TextFile1.txt";
// C:\Inetpub\wwwroot\Test\TextFile1.txt
fileName = this.Server.MapPath("~/" + fileName);
System.IO.FileInfo fileInfo = new System.IO.FileInfo(fileName);
this.Response.Clear();
this.Response.AddHeader("Content-Length", fileInfo.Length.ToString());
this.Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName);
this.Response.ContentType = "application/octet-stream";
this.Response.WriteFile(fileInfo.FullName);
this.Response.Flush();
this.Response.End();If you have an apple and I have an apple and we exchange these apples then you and I will still each have one apple. But if you have an idea and I have an idea and we exchange these ideas, then each of us will have two ideas.
هذا الموضوع مغلق.