•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 402,510 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,667 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser: Programming Forums
Views: 2950 | Replies: 6
![]() |
•
•
Join Date: Jan 2008
Location: Punjab(....India....)
Posts: 31
Reputation:
Rep Power: 1
Solved Threads: 2
Hi Developers.....
I have a Problem.... I have a XML file.....n I have to Read the Data from that XML file n Create a New File and the Data is in a Binary Format.....(All the code is in C# only)
I have used the BinaryReader,BinaryWriter and BinaryFormatter but i can't able to solve this problem.....if i use the array of byte then the data comes in array is in ASCII code and then i convert each n every word into binary is a very very huge process.......Is there any Function in C#.Net by which i can convert my XML file to a Binary Format File.....
Every Comment will be Welcome.....
Thanx
I have a Problem.... I have a XML file.....n I have to Read the Data from that XML file n Create a New File and the Data is in a Binary Format.....(All the code is in C# only)
I have used the BinaryReader,BinaryWriter and BinaryFormatter but i can't able to solve this problem.....if i use the array of byte then the data comes in array is in ASCII code and then i convert each n every word into binary is a very very huge process.......Is there any Function in C#.Net by which i can convert my XML file to a Binary Format File.....
Every Comment will be Welcome.....
Thanx
Just read your XML file as normal file, then write this data to your binary file
string xmlData = File.ReadAllText("path.xml");FileStream fs = new FileStream("path.txt", FileMode.OpenOrCreate);
BinaryWriter sw = new BinaryWriter(fs);
sw.Write(s);
sw.Close(); B.Sc Computer Science, Helwan University
Microsoft Student Partner
Personal blog http://ramymahrous.blogspot.com/
Arabic technical blog http://fci-h-ar.blogspot.com/
English technical blog http://fci-h.blogspot.com/
Microsoft Student Partner
Personal blog http://ramymahrous.blogspot.com/
Arabic technical blog http://fci-h-ar.blogspot.com/
English technical blog http://fci-h.blogspot.com/
•
•
Join Date: Jan 2008
Location: Punjab(....India....)
Posts: 31
Reputation:
Rep Power: 1
Solved Threads: 2
•
•
•
•
Just read your XML file as normal file,then write this data to your binary filestring xmlData = File.ReadAllText("path.xml");
FileStream fs = new FileStream("path.txt", FileMode.OpenOrCreate); BinaryWriter sw = new BinaryWriter(fs); sw.Write(s); sw.Close();
No, Its Not Working......it shows the same data........in XML format
Encrypt your data!!!
B.Sc Computer Science, Helwan University
Microsoft Student Partner
Personal blog http://ramymahrous.blogspot.com/
Arabic technical blog http://fci-h-ar.blogspot.com/
English technical blog http://fci-h.blogspot.com/
Microsoft Student Partner
Personal blog http://ramymahrous.blogspot.com/
Arabic technical blog http://fci-h-ar.blogspot.com/
English technical blog http://fci-h.blogspot.com/
•
•
Join Date: Jan 2008
Location: Punjab(....India....)
Posts: 31
Reputation:
Rep Power: 1
Solved Threads: 2
System.Security.Cryptography may help you for stronger and better encryption!
B.Sc Computer Science, Helwan University
Microsoft Student Partner
Personal blog http://ramymahrous.blogspot.com/
Arabic technical blog http://fci-h-ar.blogspot.com/
English technical blog http://fci-h.blogspot.com/
Microsoft Student Partner
Personal blog http://ramymahrous.blogspot.com/
Arabic technical blog http://fci-h-ar.blogspot.com/
English technical blog http://fci-h.blogspot.com/
![]() |
•
•
•
•
•
•
•
•
DaniWeb C# Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- converting a text or xml file into binary format (Visual Basic 4 / 5 / 6)
Other Threads in the C# Forum
- Previous Thread: How would I send a remote command to a UNIX box from a PC using C#?
- Next Thread: C# Forms View


Linear Mode