الأربعاء، 18 مارس 2015

عرض PDF في الصفحة Asp.net

string filepath = r;                                // r هو مسار الملف
            byte[] bts = System.IO.File.ReadAllBytes(Server .MapPath ( filepath));
            Response.Clear();
            Response.ClearHeaders();
            Response.ContentType = "application/pdf";
            Response.WriteFile(Server .MapPath ( filepath));
            Response.Flush();
            Response.End();

ليست هناك تعليقات:

إرسال تعليق