コード例 #1
0
        public ActionResult Viewer(string SourceFile, string FileType, string DocNumber, string DocVer, string FileName)
        {
            SourceFile = Server.UrlDecode(SourceFile);
            DocumentViewer model = new DocumentViewer();

            model.DocNumber = Server.UrlDecode(DocNumber);
            model.DocVer    = DocVer;
            model.FileName  = Server.UrlDecode(FileName);
            if (FileType.Equals(".pdf"))
            {
                model.DocumentPath = "/WorkSpaces/" + SourceFile;
            }
            else
            {
                try
                {
                    SourceFile = Server.MapPath("~/WorkSpaces/" + SourceFile);
                    string response = DocumentHelper.ConvertToMht(SourceFile, FileType);
                    response           = response.Replace(Server.MapPath("~/WorkSpaces/"), "/WorkSpaces/").Replace("\\", "/");
                    model.DocumentPath = response;
                }
                catch (Exception ex) {
                }
            }
            return(PartialView(model));
        }