Click here to Skip to main content
15,892,797 members
Everything / Binary

Binary

binary

Great Reads

by Christ Kennedy
A graphically bouncy and colorful version of the popular numbers tile-sliding game
by honey the codewitch
BinaryReader and BinaryWriter can be used to parse or write binary files more easily and in a portable manner
by Member 13376231
An overview of a tricky binary collision example when there are multiple definitions of symbols in linked binaries
by PIEBALDconsult
I wasn't going to publish this version, but I just used it a second time, so maybe someone else will need it too. This is very much like the second version above except that it uses a non-generic IList. Today, I used this to find and insert TreeNodes in a TreeNodeCollection, yesterday I used it...

Latest Articles

by Jovibor
Library for parsing internal structures of PE32/PE32+ binary files.
by Member 13376231
An overview of a tricky binary collision example when there are multiple definitions of symbols in linked binaries
by Christ Kennedy
A graphically bouncy and colorful version of the popular numbers tile-sliding game
by honey the codewitch
BinaryReader and BinaryWriter can be used to parse or write binary files more easily and in a portable manner

All Articles

Sort by Updated

Binary 

21 Nov 2011 by Abhinav S
Try outMP3 Player Server Control[^]http://ultidevwebbasedmp3pl.codeplex.com/[^]http://www.asp.net/community/control-gallery/Item.aspx?i=2015[^]http://www.aspnetmedia.com/[^]http://www.wonderhowto.com/how-to-play-mp3s-asp-net-web-applications-259021/[^]
21 Jan 2013 by Abhinav S
Use the BinaryReader.Here are some examples -http://www.dotnetperls.com/binaryreader-vbnet[^]http://kellyschronicles.wordpress.com/2009/04/09/read-a-binary-file-with-vb-net/[^]Here is a video - http://www.youtube.com/watch?v=X_aQIVYZsCs[^].
20 Jan 2013 by Alamgirable
I want to compress binary data.Suppose i have two binary values 01000100 and 01000010.I want to compress them like this: 01000100 = 101000010 = 0After compress the 2bytes would be converted to 2bitsand decompress them like: 1 = 010001000 = 01000010After decompress the...
21 Jan 2013 by Alamgirable
How to read binary file OR How to access binary file in visual.As anyone knows that computer working on binary (0s and 1s).Every file/data have its binary source.I want to Read/Access and edit binary of data/files in visual basic.
21 Jan 2013 by Alamgirable
As anyone knows that computer working on binary (0s and 1s).Every file/data have its binary source.I want to Read/Access and edit binary of data/files like(.MP4 , .MP3, .ISO etc) in visual basic. How can is do that?
4 Feb 2013 by Alamgirable
How to input/output binary of files those are stored in my hard disk.I also want to edit binary.
20 Feb 2013 by Alamgirable
I want to I/O files in binary(means in 0s and 1s).I also want to edit these 0s and 1s of files.I have no idea how to do that... please help me.
21 Mar 2013 by Alamgirable
Where is the best place to start working with data compression in c++.I want to compress data ontwo endpoints on one endpoint i want to compress data and on other i want decompress.Please help me.
4 Feb 2013 by Albert Holguin
Well, you treat binary files (almost) the same as you would any other type of file. If you use fopen, just add that little "b" in the mode to tell it you're working in straight binary mode (see here[^]).As far as handling it within your code once the file is open, well, you have to know how...
17 Feb 2015 by Alberto M.
This article describes the file format NBT and shows how can be implemented in a real application to store data.
2 Dec 2012 by Alfred16
I wrote this code for simulating multiplication of 4 bit binary numbers stored in arrays BeforeDecimal1 & BeforeDecimal2. The result of multiplication is stored in arrays s[]. The problem is this code isn't providing correct answer. I tried to figure out the problem but worthless, so now I seek...
12 Jan 2013 by Alfred16
I am required to write a code which multiplies two floating point numbers in binary format. The code works fine when I give an integer input, but doesn't give correct result for floating point input. When I give an input for example:3.2 and 12.2I am getting this...
23 May 2011 by algrn912005
Hi,I've come to a roadblock in an application I'm trying to make.I'm trying to create an application that will read in a binary file. I'm using the binaryreader class. The binary file is written using the put method in vb6. The data inside the binary file will be in this form:Private...
8 Dec 2016 by Ali Majed HA
HelloI have an element in my .html file. When user select his/her image, I get the selected image using JavaScript and send it to controller as JSON:var _Data = { Image = $("#ImageFileUpload").val();and in my controller, I save it in my Data Base:byte[] binData;byte[] byteArrey...
4 Jan 2018 by Amedora Ahmed
I am reading binary data image from a serial port device how can i write it to a black and white image file. The project is a bill counting machine which solution. the device scans images of serial number of bill counted including the data counter Below is the data returned from the device as...
13 Jan 2013 by Andreas Gieriet
I assume you talk about IEEE 754[^] floating point numbers.Such a number hassignmantissaexponent (which is shifted by a bias)some special values that indicate +/- infinity, not-a-number (NaN)Leaving away the special cases, you must knowhow the sign, mantissa, and exponent...
14 Jan 2013 by Andreas Gieriet
In my first solution to your question I took your question too literal: you ask for a floating point solution.Reading now your expected result shows that you in fact talk about a fixed point problem.A fix point approach places the separation between integral part and the fraction part at a...
17 Mar 2022 by Aniket Mani
Question---> Print a single base-10 integer that denotes the maximum number of consecutive's 1 in the binary representation of N. Here, N == (input given by the user) My approach--> #include int main(){ int n,count=0,max=0; ...
22 Jan 2013 by anonymous10
I want make data sharing between two users by creating multiple conections so the data will travel fast.I want to make software like internet download.Internet download manger create multiple conections with a single server and download data in different pieces.How can i do it with visual...
23 Jan 2013 by anonymous10
For example:I have a text file and the given below is that binary source code of text file:01001101 01111001 00100000 01101110 01100001 01101101 01100101 00100000 01101001 01110011 00100000 01010100 01100101 01100011 01101000 01101110 01101111 01101100I would like to send all bytes (8 bits...
3 Feb 2013 by anonymous10
which programming language is more familiar if we are going to work with binary.
4 Feb 2013 by anonymous10
How to read binary file and change it.For example:Every data/file in our computer have its binary source which is only 0s and 1s.I have a binary file in which 01000100 is mostly used.i want to change 01000100 with 01100100 How can i do that in c++?
5 Feb 2013 by anonymous10
Suppose i have two binary values 01000100 and 01000010.I want to compress them like this:01000100 = 101000010 = 0After compress the 2bytes would be converted to 2bitsand decompress them like:1 = 010001000 = 01000010After decompress the 2bits would be converted to 2bytes...
31 May 2011 by ArmandoQ
Hello!I need to find a way in C# to parse a binary file which contains an image in raw data (no headers, metadata, compresssion, etc.) in a 2-2-2-2 format. This is 2 bits for each RGB color and 2 bits for opacity. I need to read it and display the resulting image. I am new to C# and have not...
19 Feb 2013 by Arun1_m1
create table #bitoprt(id int identity(1,1),bag bit,tapee bit,band bit,knife bit,guitar bit,watch bit,umbrella bit,hammer bit)insert into #bitoprtvalues(0, 1, 1, 0, 1, 1, 1, 0), ( 0, 1, 1, 0, 1, 1, 0, 0), ( 0, 1, 1, 0, 0, 0, 0, 0)select (bt.bag...
10 Apr 2022 by Ashkan X
Hi guys i want to know how can i print how many this code try to find the target for example we have a list of numbers : 4,6,7,8,10,12,17,21 and we want to find 17 in that case we know linear search would be = 7 compare and binary search...
20 Jan 2013 by Ashok19r91d
You can't Perform That Operation, With Build-in Visual Basic Function and even User Defined Function (unless you have your Very own Algorithm), If you have Your Very Own Logic on this Then Consider Improving Your Solution with Your Algorithm.But in My Opinion, There are 256 (2^8) Binary...
20 Jan 2013 by Ashok19r91d
Function CompressText (ByVal TextToCompress as String) As IntegerIf TextToCompress = "01000100" Then Return 1If TextToCompress = "01000010" Then Return 0End FunctionFunction DeCompressText (ByVal TextToDeCompress as String) As StringIf TextToDeCompress = 1 Then Return "01000100"...
5 Sep 2011 by bandroid
HiI am developing a web application. In this application a user can upload and download a file .pdf and stored in Sql Server as binary.I show the list of files in a gridview. When user clicks on a download button in gridview it can be downloaded the file on client side.Can some one help...
2 Jun 2012 by Ben Baron
Java source code to demonstrate Executable Integration which is a concept of integrating several distinct executables to create a single application
8 Jun 2018 by BerthaDusStuf
I am reading jumping into c++ and in it there is this code that is made to insert into a tree: node* insert (node *p_tree, int key) { // base case--we have reached an empty tree and need to insert our new // node here if ( p_tree == NULL ) { node* p_new_tree = new node; p_new_tree->p_left =...
20 Dec 2014 by BillWoodruff
Just in case these utility methods may assist you:public static List BinaryStringToBitsAreOnes(string theString){ return theString.Select(ch => ch == '1').ToList();}public static List StringToCharsAsBinary(string theString){ return theString.Select(ch =>...
5 May 2021 by Blake Miller
I have two PML files. One from a system that 'works' and one from a system that does not. I want to compare the two PML files and find the 'differences', which could indicate why the system that is broken, is broken. There are hundreds of 'false...
17 Jan 2013 by blertag
public Node findmin(Node Root) { if (Root == null) return null; else if (Root.leftChild == null) return Root; else return findmin(Root.leftChild); } public Node findmax(Node...
18 Oct 2014 by BlOcker Mslm
Hello programmers ! I know is a crazy question, frenzy and very klutzy, but is there any one asks herself how he can program an application without using Win32 API? I have this question since a very large time and I don't have any answers until the moment. To know how to program...
19 Oct 2014 by BlOcker Mslm
Waiting for other solutions...
15 Feb 2012 by BobJanova
I typically write explicit ToBytes/FromBytes* methods on classes I want to transfer. This is pretty fast, and allows you to choose exactly what state information needs to be transferred (any automated serialiser will take everything, and will have to use reflection to find the properties to...
18 Jun 2013 by brknlpr
hello everybody I have question I am trying to do a hexeditor and I can read bin file in hex mode but I cannot read it as ascii.I am using this functionprivate static string hx2Asc(string hxStr) { byte[] tmp; int j = 0; tmp = new...
3 Dec 2011 by Captain Price
I've created a text file Encoded in ASCII. It Contains the Following Text;abcd123Binary value of the above text ;01100001 01100010 01100011 01100100 0110001 0110010 0110011 How Can I do this (getting binary value of a file to a text box) in C# ?
22 May 2022 by Carol H
I wanted to display binary image from my database in Jquery datatable, I have tried a few ways but did not work as well. This is my DataTable: "columns": [ { "data": "Product_ID" }, { "data": "Product_Name" }, { "data":...
22 May 2021 by Casper Josiah
I'm trying to write a binary Search tree to a text file in sorted order, my write method is in my BST class. When I print out the BST in Order Tranversal it works perfectly. When I try to write it to a text file it works but the current node...
8 Apr 2021 by Chopin2001
I posted a question on this issue. Fault reading data struct on linux[^] To recapitulate, binary data created on Windows is loaded from Linux. But it doesn't work on Linux. While contemplating a solution, I wanted to know how binary data would...
10 Apr 2021 by Chopin2001
I have been contemplating this issue a few days. Binary files created on Windows are read on Linux. It is handled normally on Windows. But not on Linux. To check more I checked the file values ​​with a function like this: File_*fp = open(dir,...
6 Oct 2020 by Christ Kennedy
A graphically bouncy and colorful version of the popular numbers tile-sliding game
2 May 2014 by Coder_Jack
I am trying to make a complete tree recursive but It randomly adds element in order. How do I convert this binary search tree to a complete tree. Thanks in advance. @Override public boolean offer(E item) { if(root == null){ root = new Node(item); ...
10 Jan 2012 by CodyDaemon
I few things which should help on the speed front...Open the file and keep it open, and just write data to it as it comes in, and then close the file when the program exits. Open and closing files for each packet is just overhead which can easily removed.Why are you writing each 'int' by...
6 Feb 2012 by Corporal Agarn
Google is our friend.Have you tried CAST(bin AS VARCHAR(50)) where bin is your column. Note if this is encrypted you will not be able to do this.
5 May 2016 by corupted
i have a binary search tree that stores details of countries financial situation,i have added all the countries now i just want to search them by countrynamei have a find method in my BST class that is supposed to do that but it doesnt work, it doesent print anything when i call...
31 May 2011 by CPallini
If you are using System.Drawing then you may create a bitmap of the same size then use the SetPixel method (or, if performance matters, the LockBits one, see Bitmap.Lockbits[^] at MSDN). The straighforward transformation of the RGBA components is the simple multiplication by 64 85 (sorry 64 was...
24 Oct 2012 by CPallini
If it is actually a video file then, yes, the 'change-extension' trick could work.
2 Dec 2012 by CPallini
Bit long, but should work:#include void mul(int bd1[4], int bd2[4], int s[8]){ int i,j; for (i=0;i
23 Jan 2013 by CPallini
Have a look at the following MSDN's code samples: Socket Code Examples[^].
4 Feb 2013 by CPallini
If you need to change the content of a file (that is overwrite it) then you have to:Read the file content into memory.Modify memory content.Write back modified memory content to the original file.You may use the C++ fstream to read/write a binary file, see, for instance Input/Output with...
17 Dec 2013 by CPallini
Microsoft genlty provides an article on the argument: "An Extensive Examination of Data Structures Using C# 2.0 - Part 3: Binary Trees and BSTs"[^].
6 May 2014 by CPallini
Some insight here: "comparison operator values C++" at Stack Overflow[^].
12 Nov 2015 by CPallini
Your program actually does save in binary format (if you write plain text in a binary file the it will contain, well, plain text). You may see strange output (you call it 'binary') depending on the application you use to inspect the file.
21 Dec 2017 by CPallini
Don't use globals. Parametrize your functions, instead. Try #include #include #include typedef struct { int day; int month; int year; } dateStruct; typedef struct { char title[100]; char author[100]; char publisher[100]; char ISBN[30]; dateStruct...
4 Feb 2018 by CPallini
Yes you can. The compiler happily accetps fin.read((char*)&s,sizeof(student)); As you may easily verify. The form fin.read((char*)&s,sizeof(s)); however is more robust (if you change the type of s it remains correct).
14 Feb 2018 by CPallini
I would write: static int findSubArray(int arr[]) { int max_size = -1, start_index = 0; int end_index = 0; int start_sequence=0; boolean in_sequence = false; int n = arr.length; for (int i = 0; i
17 Jan 2022 by CPallini
public static byte [] getNibbles(UInt32 ui32) { const int Nibbles = 8; byte [] b = new byte[Nibbles]; for ( int n=0; n>= 4; } return b; }
11 Jul 2022 by CPallini
Here, for instance, you may find a description (and an example) of such a method: Binary Calculator[^].
8 Dec 2016 by Daniel Jones
Using VB.NEThttps://www.codeproject.com/Articles/437937/Save-and-Retrieve-Image-from-a-SQL-Server-Database[^]Using asp.nethttp://www.dotnetgallery.com/kb/resource21-How-to-store-and-retrieve-images-from-SQL-server-database-using-aspnet.aspx.aspx[^]
17 Jul 2016 by Dave Kreskowiak
Why?The format has been "dead" for quite a while now. You're not going to find a "tutorial" on it.You will, however, find documentation on it. Google results[^]
29 Aug 2018 by Dave Kreskowiak
Your question shows a ton of naivety. All files are already "binary". So you're going to have to explain what you mean by this. Are you looking to show the content in a hex-editor format, with the offset and byte value at that offset along with a text representation of that byte? .BIN files...
17 Sep 2013 by DaveyM69
Have you had a look at this[^]?
1 Nov 2012 by Deenuji
I need code for string to binary conversion in asp.net??? then i need code as well as encryption and decryption in asp.net???? pls help me guys???
1 Nov 2012 by Deenuji
How to convert text to binary and octal and hexadecimal in asp.net???? actually i want to generate some secret key and public key using given upload text????
1 Nov 2012 by Deenuji
1st write this function on your page:public static string ConvertToBin(string asciiString) { StringBuilder sb = new StringBuilder(); foreach (string letter in asciiString.Select(c => Convert.ToString(c, 8))) { sb.Append(letter); } ...
18 Feb 2013 by Deenuji
I have sql table like below....Id Bag Tapee Band shoes knife guitar watch umbrella hammer1 1 0 1 1 0 1 1 1 02 0 0 1 1 0 1 1 0 03 0 0 1 1 0 0 0 0 0 i wanna do AND Operation using transcation id....For example i do AND Operation for transcation id 1 and 2 means we can get...
12 Mar 2013 by Deenuji
how to store my finger thumb in sql database...the following coding check my thumb 4 times and get verified....but i dont know how to store this thumb in sql database...pls guide me....my coding:public partial class EnrollmentForm : Form { // Constructor public...
9 Mar 2015 by Divakar Raj M
I have an web application which reads varbinary from SQL as a byte array in code. Basically it does a ExecuteScalar of the column and returns it as a byte array.I am now doing a mini version of the application as a Windows application. For this, I am trying to skip the DB connection. I am...
10 Mar 2015 by Divakar Raj M
I got it using this piece of code string hex = richTextBox1.Text int NumberChars = hex.Length; byte[] bytes = new byte[NumberChars / 2]; for (int i = 0; i
13 May 2016 by Dmitriy Gakh
I have no enough data about your solution and logic, but this code seems working without runtime errors (if it does not resolve your problem completely, it could be helpful to improve the situation and understand the code better):private void btnDelete_Click(object sender, EventArgs e) ...
29 Aug 2013 by dudefromthebronx
I'm working on an app in C# where I have a textbox on a Windows form. I need to read data from the textbox line by line and write it to a binary file. Each line contains either a string or an integer. I want to use StreamReader to read from the textbox and BinaryWriter to write it to a binary...
22 Feb 2021 by Dzhud10
1) 2) I'm curious. Number 1) is a base64 image and can both be encoded and...
19 Oct 2015 by Dzianis Igaravich Leanenka
Hello to everyonethere is a small question: how can I open a file as a sequence of hex data? The file may be of any extension: pic, jpeg, mp4 and so on. Such a sequence is needed to perform data encryption.Thank you in advance
13 May 2013 by E.F. Nijboer
Needs to be done with an explicit cast. More info here:http://msdn.microsoft.com/en-us/library/aa226054%28v=sql.80%29.aspx[^]Good luck!
6 May 2014 by EbolaHost
Well...False is 00000000 so true must be 11111111=-1 in decimal system(255 unsigned)In all of the other programming languages I know(not many) true is equal to -1 which makes more sense...how can NOT(FALSE) be something else than NOT(00000000) ?Thank you !!
16 Sep 2013 by ellasaro
So I have this weird problem,I wrote a program in Visual Studio 2010.At first I configured it so the binary would have an icon, lets call it icon A. Then I changed the configuration again and changed the icon to icon B. The problem is that if I copy/move my binary to my desktop the...
4 Feb 2013 by Emilio Garavaglia
Using the C++ standard library, you have to construct (or open) an std::fstream giving the appropriate mode flags (ios_base::binary)See http://en.cppreference.com/w/cpp/io/basic_fstream/basic_fstream[^]After that, use only unformatted i/o methods (like istream::read and ostream::write)...
8 Dec 2014 by enhzflep
It's actually pretty easy, if one is vaguely familiar with image-based programming tasks.I left a description of the file format in a comment above, though this can be seen from the code below.I first tried to create the new image and then use GDI+ to save it as a PNG complete with 16...
7 Dec 2016 by Er. Puneet Goel
Storing image to SQL and accessing them back is lot easier. Please check hereHow to save ( insert ) Image in Database in ASP.Net using C# and VB.Net[^]
6 Mar 2016 by Ersin Enes Eryılmaz
biginteger add, subtraction, multiplication etc. 1024 bit numbers.But process with two bits (0 and 1) . for ex: 1010101010101...11100001011101010 (1024 bit)0101010101001...01111010101010111 (1024...
5 Aug 2011 by Espen Harlinn
Here is an extended ascii table:http://www.commfront.com/ascii-chart-table.htm[^]Hex value of T=54Hex value of M=4DHex value of D=44Hex value of N=4EHex value of P=50Hex value of 6=36Convert pairs of charaters to bytes using NumberStyles.HexNumber[^] with the Byte.TryParse[^]...
5 Mar 2012 by Felipe Gentil
One more tutorial here :)http://codeabout.wordpress.com/2012/03/02/saving-files-into-your-sql-database-with-c/[^]
5 Mar 2012 by Felipe Gentil
You can use thishttp://codeabout.wordpress.com/2012/03/02/saving-files-into-your-sql-database-with-c/[^]to catch the file and then use http://sourceforge.net/projects/itextsharp/[^]to print in a pdf file :) Hope it helps!
3 Jul 2018 by Fiínek Cahů
Hello How can I edit code and seve it. I try to edit password in exe file: my steps are: SEARCH FOR-> ALL REF. AND STRINGS / FOLLOW IN DUMP -> IMMEDIATE CONST. CTRL+E FOR EDIT VALUE COPY TO EXECUTABLE RIGHT CLICK AND SAVE. IT IS OK? Thank you https://ibb.co/mL78NJ https://ibb.co/kuhxGd...
29 Feb 2012 by fjdiewornncalwe
Your first choice should always be to google your question first.C# PDF[^] returned about 115,000,000 results. Lots of good stuff there too.
10 Jan 2012 by GabeA
I am currently working on a program that receives UDP packets of size 1460 bytes per packet and continuously streams the bytes to the hard drive of my PC. Currently, my program can only receive and stream 84 packets before data loss occurs. I need my program to be realtime with a fast sampling...
1 Sep 2018 by Galarist_00
My problem is, when I import a csv file to datagridview, then the binary search is working very well. For the second time as well. After the third time, the binary-search is not working well. It does not finds any object from the ArrayList. I use Windows application for this project. What I...
10 May 2012 by Ganesan Senthilvel
You can write the below code to achieve it:Response.Clear()Response.AppendHeader("Content-Disposition", "inline; filename=yourfile.pdf")Response.ContentType = "application/pdf"Response.BinaryWrite(binaryData)Response.End()
16 Apr 2012 by Ganesh Kumar Kaki
HiCan anyone one tell me how to display image in a gridview.My image is in Binary Format(image data type) in my databaseNeed help.plz...
3 Oct 2012 by ggoutam7
Hello,I am trying to fix this bug. Please help.I am getting below error and no data inserted :"Must declare the scalar variable "@bytImage"." Public Sub InsertFile() Dim sMainFolder As String = "D:\Project" Dim conAccess As Data.OleDb.OleDbConnection ...
28 Sep 2014 by gopesh2010
Try removing equal from while(max>=min)So change while(max>=min) to while(max>min)
22 Jul 2021 by Greg Utas
If you're doing this on your own, you've chosen something that seems beyond your current skill set, so you should start with easier programming problems. If this is an assignment, it would hardly be the first one that you've been given. My guess...
17 Mar 2022 by Greg Utas
if(n & 0x01) will be true if n is odd (ends in a "1" bit). And n >>= 1 will shift n right by one bit, dropping off the low-order bit so that you can check the next one. The rest is up to you.
13 Jan 2013 by H.Brydon
Call me paranoid but I did not follow your link (sorry).By "floating point", I assume you are talking about an arbitrary number of digits in "xxx.xxx" format and not the floating point values stored in float and double values, which are handled by machine hardware.The first thing you...
6 Feb 2013 by H.Brydon
Pretty simple if you only have 2 input and 2 output values.char Compress(char in){ if(68 == in) return 1; // 01000100 -> 1 if(66 == in) return 0; // 01000010 -> 0 return -1; // invalid}char Decompress(char in){ if(1 == in) return 68; // 1 -> 01000100...
20 Jul 2011 by helldevil1912
I want to get information of ASF file as bitrate, metadata, language...I have read ASF Specification and know a ASF file has parts : Header Object, Data Object, Index Object. At frist, I think ASF file's binary file and i try to solve by CLASS and FUNCTION in C# as : FileStream, BinaryReader...
25 Aug 2019 by higii
Trying to learn about Binary Tree while preparing for an exam, and I came across this code. And even tho it looks like it makes sense I simply cannot understand the purpose of this and how it actually works, so can anyone please elaborate? And this is the code : space += 5; ...