Click here to Skip to main content
15,895,011 members
Home / Discussions / C#
   

C#

 
AnswerRe: read from DAT file Pin
Dave Herren24-May-07 6:31
Dave Herren24-May-07 6:31 
QuestionWebbrowser Control--- Text To HTML Pin
chettu24-May-07 4:22
chettu24-May-07 4:22 
AnswerRe: Webbrowser Control--- Text To HTML Pin
Dave Herren24-May-07 4:37
Dave Herren24-May-07 4:37 
GeneralRe: Webbrowser Control--- Text To HTML Pin
chettu24-May-07 6:16
chettu24-May-07 6:16 
QuestionBinary or Non-Binary File Pin
DotNetDominator24-May-07 3:27
DotNetDominator24-May-07 3:27 
AnswerRe: Binary or Non-Binary File Pin
Judah Gabriel Himango24-May-07 5:33
sponsorJudah Gabriel Himango24-May-07 5:33 
AnswerRe: Binary or Non-Binary File Pin
Luc Pattyn24-May-07 6:10
sitebuilderLuc Pattyn24-May-07 6:10 
GeneralRe: Binary or Non-Binary File Pin
DotNetDominator24-May-07 9:33
DotNetDominator24-May-07 9:33 
Of course, all files are Binary, but i want to differentiate files based on the printable characters they contain. Basically, i need it for a utility which would compare two files and write the differences between them to third file, or may update one file by comparing it to the others. I can only tell this much. Since, such comparision for "binary" files like DLL, Jar etc are meaningless i wanted to identify them before i compare them. I can't change the utility i will use for such comparision. I wrote following method, which i think would work fine. Do you think it would work across all character sets? I am just reading file byte by byte and looking for a byte which is zero. Then i know that the file is binary.

static bool isBinary(ref BinaryReader binaryReader) {
bool nullByteFound = false;
int i = 0;
byte unsignedByte;
while (i < binaryReader.BaseStream.Length) {
unsignedByte = binaryReader.ReadByte();

if (unsignedByte == 0){
nullByteFound = true;
break;
}
i++;
}
Console.WriteLine("Bull= " + nullByteFound);
return nullByteFound;
}


The other API IsTextUnicode may also help in solving problem if i retrieve IS_TEXT_UNICODE_NULL_BYTES flag. Thanks all for your help on this.
GeneralRe: Binary or Non-Binary File Pin
Luc Pattyn24-May-07 9:59
sitebuilderLuc Pattyn24-May-07 9:59 
QuestionI am getting PDF error Pin
adilkazmi24-May-07 3:08
adilkazmi24-May-07 3:08 
AnswerRe: I am getting PDF error Pin
Colin Angus Mackay24-May-07 4:47
Colin Angus Mackay24-May-07 4:47 
JokeRe: I am getting PDF error Pin
Martin#24-May-07 5:17
Martin#24-May-07 5:17 
QuestionHow do I create a dock able toolbar in C# like the office toolbar Pin
Sagar Pattnayak24-May-07 3:06
Sagar Pattnayak24-May-07 3:06 
AnswerRe: How do I create a dock able toolbar in C# like the office toolbar Pin
Martin#24-May-07 3:15
Martin#24-May-07 3:15 
QuestionContext Menu Click Pin
deep_C#24-May-07 2:21
deep_C#24-May-07 2:21 
AnswerRe: Context Menu Click Pin
Giorgi Dalakishvili24-May-07 2:26
mentorGiorgi Dalakishvili24-May-07 2:26 
QuestionRe: Context Menu Click Pin
deep_C#24-May-07 2:35
deep_C#24-May-07 2:35 
AnswerRe: Context Menu Click Pin
Giorgi Dalakishvili24-May-07 2:38
mentorGiorgi Dalakishvili24-May-07 2:38 
GeneralRe: Context Menu Click Pin
deep_C#24-May-07 2:58
deep_C#24-May-07 2:58 
AnswerRe: Context Menu Click Pin
Martin#24-May-07 2:39
Martin#24-May-07 2:39 
GeneralRe: Context Menu Click Pin
deep_C#24-May-07 2:58
deep_C#24-May-07 2:58 
GeneralRe: Context Menu Click Pin
Martin#24-May-07 3:21
Martin#24-May-07 3:21 
Questionwhich class is it calling? Pin
jon-8024-May-07 1:31
professionaljon-8024-May-07 1:31 
AnswerRe: which class is it calling? Pin
CPallini24-May-07 1:41
mveCPallini24-May-07 1:41 
GeneralRe: which class is it calling? Pin
jon-8024-May-07 2:59
professionaljon-8024-May-07 2:59 

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.