解析通过ASP上传的XML文件:文件上传 [英] Parse XML file uploaded through asp:FileUpload

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

问题描述

我有一种情况,用户会上传一个XML文件,我想将文件添加到表在我的数据库。困难的部分,不过,是我需要解析该文件,然后一些信息添加到一些不同的表。

I have a scenario where a user will upload an XML file, and I'd like to add the file to a table in my database. The hard part, though, is that I need to parse the file and then add some of the information to some different tables.

显示如何获得一个XML文件中使用URI来获取文件,但你如何从数据库或,$ P $获取文件直接pferably,从ASP的每个例子:上回发FileUpload控件

Every example showing how to get an XML file use a URI to get the file, but how do you get the file straight from either the database or, preferably, from the asp:FileUpload control on postback?

推荐答案

看看的的 XMLDocument.load方法方法

XmlDocument myDoc = new XmlDocument();
myDoc.Load(fu_MyFile.FileContent);

这篇关于解析通过ASP上传的XML文件:文件上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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