|
What's the best way to compare two files? I have two files. One was written as a binary file, and the other was written as a string. Looking at the files in Notepad, the characters look the same (although they are weird characters due the nature of encoding). When you use Notepad++ to do a comparison, ignoring whitespace, aligning matches, and detecting moves, showing CR and LF's, it shows the original one written as a binary with about 110 lines of CRLF's, and then the data with the correct CRLF's after each line. But it shows the one written as a string shows the data with it's CRLF's as expected, but then about 110 lines of empty CRLF's. When you show the files without the comparison tool, they line up perfectly and look the same, with the CRLF's just showing up at the end of each line of data. It turns out that Notepad++ just shows CRLF when lines don't match, so it offsets the files in the comparison viewer.
When I compare with Beyond Compare, by default, it's reading the one written as a string as UTF8 PC, and the original as Japanese. When I force the original to be UTF8 (can't figure out how to do the PC part), it shows the original file as rectangles with question marks in the center, separated by a yen symbol in the middle of each line of data (for the most part).
They look the same without the compare tools. Are they the same? The next step is to see if the one written as a string opens up in the tool ok. I'm not sure otherwise. So the old tool doesn't read the data correctly, so maybe it's not ok....
|
|
|
|
|
you can read the two files with StreamReader.Read() and compare their character codes, but what are the two files?
I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)
|
|
|
|
|
I figured it out. Wound up sending the string array to a byte array, using FileStream, and doing output.Write(<byte array="">, 0, <length-1>)
and the original file compared with the read/handled/stored/written data.
Thanks!
|
|
|
|
|
how to create an project for face detection and recognition? please tell me is there any sample for learning.
|
|
|
|
|
Please don't cross post. You already asked this, and I provided the answer here[^].
|
|
|
|
|
hi, I have a VS2010 setup project. I deploy my project with sql compact dlls' so that the target pc doesnt have to have sql compact installed. I did what's said in this link under Private File–Based Deployment ( http://msdn.microsoft.com/en-us/library/aa983326.aspx[^]
But, even my program can be installed on the target pc, it doesn't run without sql compact installed. Do I miss something? Thanks.
|
|
|
|
|
Anyone Pls help me with my connectionstring, tell me how if it's correct like this:
<add name="AliConnectionString1" connectionstring="Data Source=123appsoft.com\\biodux;Initial Catalog=Ali;Integrated Security=True" providername="System.Data.SqlClient">
I'm suspecting my connection string pls help.
Thnx.
|
|
|
|
|
Try connectionstrings.com for research.
If you need help here you have made a number of fundamental errors, read the guidelines.
What database
Example of your connection string (without password)
error you are receiving.
While we are good we are not telepathic
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I suspect he's put it in there, but hasn't realised that he has to encode the < and >.
|
|
|
|
|
|
hi
learned jagged array today and was working with them! came across two error messages
int [][]j1=new int[][];
now i get two error messages displayed
1) when i keep my cursor/pointer on the new int part then i get to see the following error message
"Wrong number of indices inside[];excepted1"
2) when i keep my cursor/pointer on the indices then the following error message is displayed
"Array creation must have array size or array "initializer".
2nd error message is pretty straight forward as it explains about the need to declare an array(row) size or initialize the(row)array in case of JAGGED ARRAYS
my question here is what is the meaning of the first error message;
modified 24-Apr-12 3:15am.
|
|
|
|
|
Hi,
You have the answer. It is what you have said. We need to specify the array size.
Regards,
Satish Pai
|
|
|
|
|
oops! that was a typo mistake! i was asking about the first error message!
|
|
|
|
|
int [][]j1=new int[][];
You are asking the system to create an array, but you have not told it how big the array should be.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
The problem is that you are defining j1 as "an array of [arrays of ints]".
So when you try to create a new instance of it, you have to tell it how many "arrays of ints" this instance will be.
If you defined
int[] arr = new int[]; then it is clearly wrong: it acan't allocate space for an unknown number of objectes, you have to say
int[] arr = new int[7];
So enter a size for the array:
int[][] j1 = new int[100][]; And all will be well.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
|
I love those "lightbulb" moments!
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
I have <big>str="ADVFGFVGVVCCG"</big> and wanna to get <big>plainText</big> from it!(I mean to get plaintext from end of code to start)
Please help !
byte[] bytes = Encoding.ASCII.GetBytes("™ںô…0Dƒہ;?ت£أ¾y");
byte[] rgbSalt = Encoding.ASCII.GetBytes("ی©¨ô\reعءfcééh£");
byte[] buffer = Encoding.UTF8.GetBytes(plainText);
byte[] rgbKey = new PasswordDeriveBytes("⑯آJٌ<'=»„&5ؤ؟Kك„y‰‚~–¹'`I½", rgbSalt, "SHA1", 2).GetBytes(256 / 8);
ICryptoTransform transform = new RijndaelManaged { Mode = CipherMode.CBC }.CreateEncryptor(rgbKey, bytes);
MemoryStream stream = new MemoryStream();
CryptoStream stream2 = new CryptoStream(stream, transform, CryptoStreamMode.Write);
stream2.Write(buffer, 0, buffer.Length);
stream2.FlushFinalBlock();
byte[] inArray = stream.ToArray();
stream.Close();
stream2.Close();
str = Convert.ToBase64String(inArray);
|
|
|
|
|
i want to post some articles,But Getting some alert message.
|
|
|
|
|
you think adding a couple of smilieys and posting again in the wrong forum is going to make a difference - you know what the definition of stupid is don't you!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
i want to post some articles,But Getting some alert message.
|
|
|
|
|
|
If you have a problem while posting articles, report this in the site bugs and suggestions section.
|
|
|
|
|
Hi,
I want to create a auto pilot script in c# window. the functionality will be - i will add list of url in notepad file and i can use either web browser control to show the content of website. when the page will be loaded first i want to click on register page, after than auto fill register form and third step will be click on register button, is there any one who can share any code.
I have done something, my program is in three parts right now
1. First i have coding to click on register button
2. under webbrowser_loaded event i have assigned value to text boxes by finding get element by name
3. and in third step i click on register button
if i put all coding in webbrowser_loaded event it always click on register button and program goes into loop.
if i manually click on register button the next step program do automatically.
then i manually click on register button
can any one help me out where i put all three steps so that system wont go into loop
thanks and regards
|
|
|
|
|
Hi,
Use a flag variables such as Boolean type. If the Register button is already clicked then, our boolean will have a true value saying this is already registered. & it won't execute the code again.
Regards,
Satish
|
|
|
|