TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
dhanu shree
NA
72
7.2k
While converting XML to JSON using c#
Mar 14 2018 2:23 PM
While converting XML to JSON using c#, By providing the data within the class,I’m getting the output.I need to fetch data from file present in folder .Could anyone please help me on this.
using Newtonsoft.Json;
using System;
using System.Windows.Forms;
using System.Xml;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
doc.LoadXml("
\r\n
Preethi
\r\n
45679
\r\n
Electronics and communication
\r\n \r\n
#1, 6th cross
\r\n
Victoria Layout
\r\n
Bangalore
\r\n
India
\r\n \r\n
\r\n");
string jsonText = JsonConvert.SerializeXmlNode(doc);
//Console.WriteLine(jsonText);
MessageBox.Show(jsonText);
}
}
}
Reply
Answers (
3
)
Vb6 exe file getting error in Windows 8.1 64 bit.
SQLite and Windows 2017 C# query of database file