asp编程: word文档、它的地址(数据库)都在服务器上。 我想把WORD文档内容显示在###.asp中怎么实现呢???

asp编程: word文档、它的地址(数据库)都在服务器上。 我想把WORD文档内容显示在###.asp中怎么实现呢???,第1张

读不了,word文档中包含了,特殊字符,特殊表格等等一些无法处理的东西
有另一种思路,可以将word另存为html后再用asp读取并显示
如果硬要用asp直接读word,最大限度只能读文本 代码如下:
<SCRIPT LANGUAGE= "JavaScript ">
<!--
var FileSource;
var FileDesource;
var word;
var xml>用FTP的形式上传即可,不限制文件格式
以下所有需要修改的地方用表示,先修改掉再用
string serverName = ""; //写你服务器IP,别直接用。。。
// This example assumes the site uses anonymous logon
NetworkCredential credentials = new NetworkCredential("anonymous", ""); //写你的FTP用户名密码
DemonstrateWebClient(serverName,credentials,filename,ftpdir);//然后调用上传方法,filename是你想要上传的文件名称,ftpdir是上传到服务器的哪个文件夹中
private static void DemonstrateWebClient(string serverName, NetworkCredential credentials, string filename, string ftpdir)
{
string serverAddress = "ftp://" + serverName + "/" + ftpdir+"/"; //注意这里的格式,很容易在前面定义错
// Create a new WebClient object and set the credentials
WebClient webClient = new WebClient();
webClientCredentials = credentials;
//// Download file
//try
//{
// string fileName = ReadFileName("download");
// string downloadAddress = serverAddress + fileName;
// ConsoleWriteLine("Downloading file " + downloadAddress);
// // The string passed in should include the URI path that has
// // the file name to be downloaded
// webClientDownloadFile(downloadAddress, fileName);
//}
//catch (WebException ex)
//{
// ConsoleWriteLine(exMessage);
//}
// Upload file
try
{
string fileName = filename;
string uploadAddress = serverAddress + fileName;
//ConsoleWriteLine("Uploading file " + uploadAddress);
webClientUploadFile(uploadAddress, "//"+fileName);//上传文件所在的本地路径在这里修改
}
catch (WebException ex)
{
//ConsoleWriteLine(exMessage);
MessageBoxShow(exMessage, "Upload failed");
}
}
}


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/13226879.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-06-23
下一篇 2023-06-23

发表评论

登录后才能评论

评论列表(0条)

保存