把文本框的值写入到xml文件中
protected void btn_write_Click(object sender, EventArgs e)
{
XmlWriterSettings settings=new XmlWriterSettings();
settings.Indent=true;
settings.IndentChars=" ";
using (XmlWriter write = XmlWriter.Create("E:\books.xml",settings))
{
write.WriteStartElement("book");
write.WriteElementString("price", txt_content.Text);
write.Flush();
}
}
相关文档:
首先要有一个简易的服务器,建立一个站点,然后站点下存放
1:crossdomain.xml 这个是跨与域策略文件,用于指定域通过Flash
Player访问本域的资源(如果服务器在本机就没有这个必要)但是远程的话就要(建议要)
文件内容:
<cross-domain-policy>
<allow-access-from domain="*" /> ......
经常见XML序列化的文章,对该序列化方式并不是太晓得,看了MSDN和一些资料后有了大致的了解,大道理讲不出来,上 代码先:
方式一 通过XmlSerialize直接序列化:
Class BeSerialized
{
//某字段
public int someFiled;
//公共类的一个可序列化的属性
private bool serialme;
public bool SerialMe
{
......
在XML文件中读取属性文件(.properties)中的元素值:
web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/conf/dataAccessContext.xml</param-value>
</context-param>
<listener>
<listener-class>
......
Integration with the XML Data Type
With the introduction of the XML data type, we wanted to also give FOR XML the ability to generate an instance of XML directly (more precisely, it generates a single row, single column rowset where the cell contains the XML data type instance).
Because of the bac ......