91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 74KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-05-07
  • 語言: 其他
  • 標簽: XML??相冊??

資源簡介

基于XML的網(wǎng)絡(luò)相冊,上傳圖片寫入到XML文件,并顯示出來

資源截圖

代碼片段和文件信息

using?System;
using?System.Data;
using?System.Configuration;
using?System.Web;
using?System.Web.Security;
using?System.Web.UI;
using?System.Web.UI.WebControls;
using?System.Web.UI.WebControls.WebParts;
using?System.Web.UI.HtmlControls;
using?System.xml;
using?System.IO;
using?System.Data.SqlClient;
using?System.Drawing;


public?partial?class?_Default?:?System.Web.UI.Page?
{
????protected?void?Page_Load(object?sender?EventArgs?e)
????{

????}
????protected?void?Button1_Click(object?sender?EventArgs?e)
????{
????????string?fileParthName?=?FileUpload1.PostedFile.FileName;
????????string?fileName?=?FileUpload1.FileName;
????????int?fileLength?=?FileUpload1.PostedFile.ContentLength;
????????if?(fileLength?????????????return;
????????else//手動將文件寫入xml文檔,必須在xml文檔中手擋創(chuàng)建dbImage根節(jié)點a???????????????????????????????????????
????????{
????????????byte[]?fileArray?=?new?byte[fileLength];
????????????Stream?streamobject?=?FileUpload1.PostedFile.InputStream;
????????????streamobject.Read(fileArray?0?fileLength);
????????????string?xmlName?=?Server.MapPath(“Writexml.xml“);
????????????xmlDocument?xmlDoc?=?new?xmlDocument();
????????????xmlDoc.Load(xmlName);
????????????xmlNode?root?=?xmlDoc.SelectSingleNode(“dbImage“);
????????????xmlNodeList?list?=?xmlDoc.SelectSingleNode(“dbImage“).ChildNodes;
????????????int?index?=?list.Count;
????????????xmlElement?sub1?=?xmlDoc.CreateElement(“image“);
????????????xmlElement?sub2?=?xmlDoc.CreateElement(“imageID“);
????????????sub2.InnerText?=?index.ToString();
????????????sub1.AppendChild(sub2);
????????????xmlElement?sub3?=?xmlDoc.CreateElement(“imageContentType“);
????????????sub3.InnerText?=?FileUpload1.PostedFile.ContentType;
????????????sub1.AppendChild(sub3);
????????????xmlElement?sub4?=?xmlDoc.CreateElement(“imageSize“);
????????????sub4.InnerText?=?fileLength.ToString();
????????????sub1.AppendChild(sub4);
????????????xmlElement?sub5?=?xmlDoc.CreateElement(“imageDescription“);
????????????sub5.InnerText?=?TextBox1.Text;
????????????sub1.AppendChild(sub5);
????????????xmlElement?sub6?=?xmlDoc.CreateElement(“imageData“);
????????????sub6.InnerText?=?Convert.Tobase64String(fileArray);
????????????sub1.AppendChild(sub6);
????????????root.AppendChild(sub1);
????????????xmlDoc.Save(xmlName);
????????????Response.Redirect(“showImage.aspx“);
????????}
????}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????1422??2009-09-18?16:34??xmlPhotp\Default.aspx

?????文件???????2440??2009-09-18?22:00??xmlPhotp\Default.aspx.cs

?????文件???????1131??2009-09-18?21:34??xmlPhotp\showImage.aspx

?????文件????????640??2009-09-18?21:31??xmlPhotp\showImage.aspx.cs

?????文件????????443??2009-09-18?21:31??xmlPhotp\ShowImg.aspx

?????文件???????1194??2009-09-18?21:59??xmlPhotp\ShowImg.aspx.cs

?????文件???????1546??2009-09-18?16:35??xmlPhotp\Web.Config

?????文件?????105371??2009-09-21?23:54??xmlPhotp\Writexml.xml

?????目錄??????????0??2009-10-31?00:00??xmlPhotp\App_Data

?????目錄??????????0??2009-10-31?00:00??xmlPhotp

-----------?---------??----------?-----??----

???????????????114187????????????????????10


評論

共有 條評論