如何使用文件上传控件 [英] how to use file upload control

查看:101
本文介绍了如何使用文件上传控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用2上传器上传两个文件。 1st是doc文件,另一个是文本文件,并将第一个文件转换为2nd。请帮助我。

解决方案

我在下一篇文章中有一个例子: MVC基本站点:第3步 - 动态布局和站点管理:AJAX,jqGrid,Controller Extensions,HTML Helpers等 [ ^ ]



还有可用的源代码,因此您应该查看 SiteSettingController 并在下一个视图中: Views \SiteSettting\Edit.cshtml


将单词转换为文本文件



涉及的步骤: -

1.从下面的链接下载Spire.Doc(或Spire.Office)

http://www.e-iceblue.com/Download/download-word-for-net-now.html [< a href =http://www.e-iceblue.com/Download/download-word-for-net-now.htmltarget =_ blanktitle =New Window> ^ ]



2.使用Spire.Doc添加dll引用并包含命名空间



; 
使用Spire.Doc.Documents;





3.加载doc文件

文档文档=  new  Document(); 
document.LoadFromFile(@D:\ FOLDER1 \ xyz.doc);





4.保存指定格式的文件

//保存doc文件。

 document.SaveToFile(xyz.txt,FileFormat.Txt)









或者你甚至可以参考这个链接


将Microsoft Word文档转换为C#中的文本文件 [ ^ ]





问候,
Praveen Nelge


i want to upload two file in using 2 uploader. 1st is doc file and another is text file and and convert first file to 2nd. plz help me.

解决方案

You have an example in my next article: MVC Basic Site: Step 3 – Dynamic Layouts and Site Admin with: AJAX, jqGrid, Controller Extensions, HTML Helpers, and more[^]

There is also source code available, so you should look in SiteSettingController and in the next view: Views\SiteSettting\Edit.cshtml


Converting word to text file

Steps involved :-
1. Download Download Spire.Doc (or Spire.Office) from the below link
http://www.e-iceblue.com/Download/download-word-for-net-now.html[^]

2. Add dll reference and include the namespace

using Spire.Doc;
using Spire.Doc.Documents;



3. Load the doc file

Document document = new Document();
document.LoadFromFile(@D:\FOLDER1\xyz.doc);



4. Save the file specifying the format
//Save doc file.

document.SaveToFile(xyz.txt, FileFormat.Txt)





or you can even refer the this link

Converting a Microsoft Word document to a text file in C#[^]


Regards,
Praveen Nelge


这篇关于如何使用文件上传控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆