Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7127805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:04:15+00:00 2026-05-28T11:04:15+00:00

this is my code and it writes only this symbols in fileout.txt. whats wrong

  • 0

this is my code and it writes only this symbols in fileout.txt. whats wrong and how to fix it?

byte[] bArray = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
        FileStream file_out = new FileStream(@"C:\fileout.txt",
            FileMode.Create);

        file_out.Write(bArray, 2, 4);

        file_out.Close();

sorry, symbols not shown here but why i dont know. this simbols ar something like upside and small r an some other symbols.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T11:04:15+00:00Added an answer on May 28, 2026 at 11:04 am

    Your output is the actual bytes, rather than the characters that represent them to English-speaking humans (and many other languages, but not all).

    The characters you would have written are some controls of mostly historical interest, though ANPA-1312 is still used by Associated Press and it uses them:

    START OF TEXT Precedes the actual text of the message. (0x01, that you skipped is the start of a heading.

    END OF TEXT End of the text. Also, Ctrl+C to end a running DOS program is this control.

    END OF TRANSMISSION Goodbye. Used as a log-out character.

    ENQUIRY You still there?

    Those in your array to print also include:

    NULL (null char, not what null means in C#): Used in some formats to represent the end of a string, “end of meaningful text”, etc.

    START OF HEADER: Mentioned above.

    ACKNOWLEDGE Yes, I’m here. Also used in TCP/IP hand-shaking.

    BELL There are still printers out there that will go ding if you send them this.

    BACKSPACE Printing u, then backspace then ¨ was once how you would write ü. Remember that if Unicode seems more complicated than ASCII. Actually it’s simpler to just have a ü. Also back and X and back and X and back and X was an old “delete”!

    CHARACTER TAB the first of these characters that you are ever likely to use in modern code that isn’t very low level. The “tab” character. Of course, it doesn’t look like much on its own.

    What you perhaps wanted was to output the characters, '0', '1', and so on.

    You could:

    Manually encode them. '0' is 0x30, '1' is 0x31. This is one of those things where you should know how to do it, but not actually do it yourself 99% of the time.

    Use a textwriter. This takes values of different types and (optionally with defined formatting rules) outputs the text that represents them. Hence

    using(FileStream file_out = new FileStream(@"C:\fileout.txt", FileMode.Create)
    using(TextWriter tw = new StreamWriter(file_out))
      for(int i = 2; i != 6; ++i)
        tw.Write(bArray[i]);
    

    This will convert the bytes to their human-readable equivalent as it goes, and pretty efficiently. It’s the same as if you’d output 0x32, 0x33, 0x34, 0x35, which will look like “2345” when opened in notepad.

    You will mostly want to write bytes directly if you’re receiving them from somewhere else (such as having created or obtained an image stream from somewhere) or doing something very low-level.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to JavaScript as well as jQuery. This is the only code I
Having this code: using (BinaryWriter writer = new BinaryWriter(File.Open(ProjectPath, FileMode.Create))) { //save something here
I have this code that basically writes to a file 5 times using IO
I have this code to write to a file, it works perfect but I
would someone please write this code: this.Loaded += (s, e) => this.loaded = true;
How can I write this code more cleanly/concisely? /// <summary> /// Creates a set
Is there a better way to write this code? I want to show a
When I write code like this in VS 2008: .h struct Patterns { string
This code does not seem to compile, I just need to write something to
Many beginning programmers write code like this: sub copy_file ($$) { my $from =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.