将字符串转换为xmlnode

编程入门 行业动态 更新时间:2024-10-11 01:20:24
本文介绍了将字符串转换为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

本文发布于:2023-11-11 08:19:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1577862.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:转换为   字符串   xmlnode

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!