Click here to Skip to main content
16,017,788 members
Home / Discussions / C#
   

C#

 
QuestionMODBUS RTU C# Pin
garinchabraziliana10-Jun-08 21:50
garinchabraziliana10-Jun-08 21:50 
AnswerRe: MODBUS RTU C# Pin
carbon_golem11-Jun-08 1:59
carbon_golem11-Jun-08 1:59 
QuestionTools for coding rules Pin
namrata510-Jun-08 21:44
namrata510-Jun-08 21:44 
AnswerRe: Tools for coding rules Pin
J a a n s10-Jun-08 21:46
professionalJ a a n s10-Jun-08 21:46 
GeneralRe: Tools for coding rules Pin
namrata510-Jun-08 22:58
namrata510-Jun-08 22:58 
AnswerRe: Tools for coding rules Pin
Kevin McFarlane11-Jun-08 0:16
Kevin McFarlane11-Jun-08 0:16 
AnswerRe: Tools for coding rules Pin
Vasudevan Deepak Kumar11-Jun-08 0:20
Vasudevan Deepak Kumar11-Jun-08 0:20 
Questiontrailing zero in memory stream Pin
George_George10-Jun-08 21:32
George_George10-Jun-08 21:32 
Hello everyone,


I am using the following code to retrieve the string content of XML, my question is why there is many trailing zeros in variable content? How to solve it?

static void Main(string[] args)
{
    MemoryStream MemoryStream1 = new MemoryStream();
    StreamWriter StreamWriter1 = new StreamWriter(MemoryStream1);
    XmlTextWriter XMLWriter1 = new XmlTextWriter(StreamWriter1);

    XMLWriter1.WriteStartDocument();

    XMLWriter1.WriteStartElement("Entity");  //root element
    XMLWriter1.WriteAttributeString("node", "Hello Node");

    //root ending
    XMLWriter1.WriteEndElement();
    XMLWriter1.WriteEndDocument();

    //flush the buffer to underlying stream
    XMLWriter1.Flush();

    string content = Encoding.UTF8.GetString(MemoryStream1.GetBuffer());

    return;

}



thanks in advance,
George
AnswerRe: trailing zero in memory stream Pin
leppie10-Jun-08 23:31
leppie10-Jun-08 23:31 
GeneralRe: trailing zero in memory stream Pin
George_George10-Jun-08 23:41
George_George10-Jun-08 23:41 
Questionhow to dynamically load pictures from Resource file Pin
Raza Hussain10-Jun-08 21:14
Raza Hussain10-Jun-08 21:14 
AnswerRe: how to dynamically load pictures from Resource file Pin
J a a n s10-Jun-08 21:22
professionalJ a a n s10-Jun-08 21:22 
QuestionBuilding Internet Explorer Tracker Service Pin
shinboxe10-Jun-08 21:10
shinboxe10-Jun-08 21:10 
QuestionScope of variable Pin
Hum Dum10-Jun-08 20:55
Hum Dum10-Jun-08 20:55 
AnswerRe: Scope of variable Pin
N a v a n e e t h10-Jun-08 20:58
N a v a n e e t h10-Jun-08 20:58 
GeneralRe: Scope of variable Pin
Hum Dum10-Jun-08 21:58
Hum Dum10-Jun-08 21:58 
AnswerRe: Scope of variable Pin
Guffa10-Jun-08 22:32
Guffa10-Jun-08 22:32 
GeneralRe: Scope of variable [modified] Pin
Hum Dum10-Jun-08 23:30
Hum Dum10-Jun-08 23:30 
AnswerRe: Scope of variable Pin
buchstaben10-Jun-08 23:45
buchstaben10-Jun-08 23:45 
GeneralRe: Scope of variable Pin
Guffa11-Jun-08 1:02
Guffa11-Jun-08 1:02 
GeneralRe: Scope of variable Pin
Hum Dum11-Jun-08 1:17
Hum Dum11-Jun-08 1:17 
QuestionReversing the string Pin
namrata510-Jun-08 20:51
namrata510-Jun-08 20:51 
AnswerRe: Reversing the string Pin
J a a n s10-Jun-08 21:09
professionalJ a a n s10-Jun-08 21:09 
AnswerRe: Reversing the string Pin
Krazy Programmer10-Jun-08 21:32
Krazy Programmer10-Jun-08 21:32 
AnswerRe: Reversing the string Pin
Roger Alsing10-Jun-08 21:37
Roger Alsing10-Jun-08 21:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.