Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

noone2407

@noone2407
About
Posts
3
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Invalid Argument in For Loop
    N noone2407

    I don't understand what you are trying to do. But if you want to write out the byte array of the file then here is the code

            DirectoryInfo da = new DirectoryInfo("C:\\\\Folder9");
            FileInfo\[\] Arr = da.GetFiles();
            FileInfo ap = Arr\[Arr.Length - 1\];
            long Totbyte = ap.Length;//file length
            string filePath = ap.FullName;//file name
            byte\[\] data = File.ReadAllBytes(filePath);//reading entire file
            for (int counter = 0; counter < Totbyte; counter++)
            {
    			Console.Write(data\[counter\]);
            }
    

    Remember that is byte array, not bit array If you to write out bit array instead of byte array, replace

    Console.Write(data[counter]);

    Into

    string yourByteString = Convert.ToString(data[counter], 2).PadLeft(8, '0');
    Console.Write(yourByteString+" ");

    C# csharp linq help question

  • Cross-thread operation not valid: Control 'errorBox' accessed from a thread other than the thread it was created on.
    N noone2407

    Set CheckForIllegalCrossThreadCalls = false; Everything will run perfectly.

    Visual Studio 2015 & .NET 4.6 help csharp database visual-studio winforms

  • Invalid Argument in For Loop
    N noone2407

    Can you comment all your code? Then I will fix it for you. PS: always check variable is null or not, if you are not sure before calling it

    C# csharp linq help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups