将字符串转换为xmlnode [英] Convert string into xmlnode

查看:107
本文介绍了将字符串转换为xmlnode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#窗体并希望将表单输入文本传递给其他.cs文件,是否可以将字符串转换为XMLNode? 

喜欢字符串文字= 我的名字;

并将其转换为XMLNode只是为了将其保存在xml文件中。





我有什么尝试过:



我已经尝试过每一个可能的解决方案进入我的小脑袋。我不想失去希望。如果有人遇到过这个问题,请分享您宝贵的解决方案..

解决方案

XmlWriter Class(System.Xml) [ ^ ]。


如果你只是想要要在类之间传递数据,不需要将它保存到文件中。



例如,请参阅OriginalGriff关于如何在两种形式之间传递数据的一系列提示: br />
在两个表格之间传递信息,第1部分:家长到孩子 [ ^ ]

在两种表格之间传递信息,第2部分:儿童到父母 [ ^ ]

在两种形式之间传递信息,第3部分:儿童到儿童 [ ^ ]



如果这没有帮助,请尝试解释您实际试图解决的问题,而不是您提出的解决实际问题的方法的问题! :)

I was working on C# windows form and wanted to pass the form input text to other .cs file, is it possible to convert string into XMLNode ?

like string text =  "My Name";

and convert it into XMLNode just to save it in xml file.



What I have tried:

I have tried every possible solution came into my little brain. i don't want to loose hope. If anyone has ever experienced this problem please share your precious solutions..

解决方案

XmlWriter Class (System.Xml)[^].


If you just want to pass data between classes, there's no need to save it to a file.

For example, see OriginalGriff's series of tips on how to pass data between two forms:
Transferring information between two forms, Part 1: Parent to Child[^]
Transferring information between two forms, Part 2: Child to Parent[^]
Transferring information between two forms, Part 3: Child to Child[^]

If that doesn't help, try explaining the problem that you're actually trying to solve, rather than the problem with your proposed solution to the real problem! :)


这篇关于将字符串转换为xmlnode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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