The Artima Developer Community
Sponsored Link

C# Answers Forum
WriteByte in new line

1 reply on 1 page. Most recent reply: Feb 21, 2003 11:16 AM by Matt Gerrans

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Branko

Posts: 9
Nickname: orbusian
Registered: Feb, 2003

WriteByte in new line Posted: Feb 20, 2003 10:10 AM
Reply to this message Reply
Advertisement
I would like to write the content of the "str" string
to a new line evry time I click on "btnSave".How could I do
this ? Here is the code:

private void btnSave_Click(object sender, System.EventArgs e)
{
System.IO.FileStream locFile =
new System.IO.FileStream("bra.txt", System.IO.FileMode.Append);
System.IO.BufferedStream buffStr = new System.IO.BufferedStream(locFile);

Node currNode = this.head.getNext();

string[] str = {Convert.ToString(currNode.getUcenik().getID()),
currNode.getUcenik().getFirstName(),
currNode.getUcenik().getSecName(),
currNode.getUcenik().getAdress(),
currNode.getUcenik().getPhoneNum(),
Convert.ToString(currNode.getUcenik().getMoney())};

foreach (string myStr in str)
{
for (int i = 0; i < myStr.Length; i++)
{
buffStr.WriteByte((byte)myStr);

}
buffStr.WriteByte(Convert.ToByte(' '));
}

buffStr.Close();
}


Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: WriteByte in new line Posted: Feb 21, 2003 11:16 AM
Reply to this message Reply
Just append a '\r' and a '\n' each time.

Flat View: This topic has 1 reply on 1 page
Topic: C++ Hash/Skip-List Previous Topic   Next Topic Topic: C# Platforms

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use