Click here to Skip to main content
15,396,106 members

Comments by Midnight Ahri (Top 23 by date)

Midnight Ahri 23-Aug-14 11:26am View
Yes, but I want to catch it before save.
When I input the same existing data, the error occur.
I'm using binding.
Midnight Ahri 31-May-14 10:24am View
Yes I am writing my own encryption methods.
You mean directly parse the file stream to .NET encryption methods?
All right then, I'll find a way to do it in blocks too.
Thank you very much for the information. :)
Midnight Ahri 31-May-14 9:33am View
Woah, I checked my memory left from task manager.
1.8 GB free, and when the first byte array loaded, 1.0 GB left.
And then an exception was thrown.

I had a question, I'm doing file encryption and it's already done except for large file.
Step by step are from reading file bytes into array, then while in the process of encryption, byte / byte are written in another array till complete, and finally the write process begin. In this case, I'm sure I had to load those bytes into memory and I had no choice except to limit the file size, or else I had to start the writing process while encryption is in progress. Is that possible?
Midnight Ahri 15-Apr-14 3:12am View
Ok, I had a question.
I tried this,
ReadAllBytes > BinaryEncryption > WriteAllBytes
ReadAllBytes > BinaryDecryption > WriteAllBytes

Any file that go thru that process will end up wrong except text document.
I tried word document and it end up corrupted.
Someone told me that it's because I encrypted the whole file.

I had just tried FileStream.Read and Write, and yes only text document worked.
Can you suggest me what read / write method to use to prevent corruption?
How about I try BinaryReader/Writer?
Midnight Ahri 15-Apr-14 1:20am View
Thank you very much for the explanation.
I read the file to do XOR with a key and rewrite it again.
ReadAllBytes corrupt the file when WriteAllBytes executed, so I think I will try FileStream first.
Midnight Ahri 15-Apr-14 0:46am View
Thank you, that's exactly where I got the code.
I had read offset and count explanation.
I need to know what condition that will cause the 'while' to loop more than once.
Midnight Ahri 16-Dec-13 1:48am View
Thats what I need to solve my problem. I apologize of my poor written code. :(
Midnight Ahri 16-Dec-13 1:13am View
Thankyou very much for your answer, it works for any files now.
Nothing is wrong in my code, the reason why it's not interesting and makes no sense is because my code is messy.
Whatever, I'm going to get A+. =D
Midnight Ahri 16-Dec-13 0:42am View
Actually this code is correct, just like what is in my lecturer powerpoint.
First step is to convert both text and key to ascii code / decimal, then convert the ascii code to binary.
Then combine both binary and convert it back to decimal, and the last step, convert back to text.
I know this encryption is stupid, what I do is also stupid.
But seriously, this is the last step, to encrypt word document.
Everything is already complete.
I can even encrypt/decrypt text document perfectly.
Just like what you said, I encrypt everything including the file binary header that represent the file type or whatever it is that was written in wikipedia.
Thats why the file corrupted.
I know that I can simply call dot net cryptography library.
But even how stupid this project is, my lecturer still able to know that I'm not doing it myself.
Midnight Ahri 3-Dec-13 3:36am View
Thank you very much for the information, it helps a lot. =D
Midnight Ahri 3-Dec-13 3:26am View
Thank you very much for the information.
How if I ignore doc / docx / whatever it is.
I'll just read the byte / byte from the file and encrypt it using vernam cipher.
I can even encrypt anything with that.
Is this a good solution?
Midnight Ahri 3-Dec-13 3:00am View
Now I got my Vernam Cipher Encryption, but still I need a way to read Word Document plain text.
I can't simply choose the file and encrypt it right?
Midnight Ahri 3-Dec-13 1:53am View
Yes it's true that Caesar Cipher is very weak.
But my main point is to get plain text from word documents.
Can you provide me information about that?
Midnight Ahri 2-Dec-13 22:46pm View
Sorry for my terrible information.
I'm using Caesar Cipher that encrypt character one by one.
Read text file, encrypt then modify text file.
I need explanation of how to read string in word document file without the xml format.
Midnight Ahri 1-Dec-13 22:02pm View
Thank you for answering, my problem is when I combine the character binary and key binary, convert it to ascii code, and convert back to char, it return \0.
Thats why the length of encryption result differ from the text.
Midnight Ahri 22-Nov-13 0:34am View
Hi, thank you for your interest in helping.
The current device is U.are.U 5000 from Digital Persona.

After googling BioFinger, I'm interested in learning how to connect to that machine.
Can you explain more about BioFinger?
Midnight Ahri 19-Sep-13 12:28pm View
Where exactly I had to put this?
I tried both custom control and my form, still nothing change.
Actually it's not only color, forexample I set multiline to true.
It's still false in the form, it's like the control didn't update anymore from my custom control.
Midnight Ahri 19-Sep-13 12:25pm View
The link is deleted.
Btw I'm pretty sure before I restore my laptop, it's still working.
Midnight Ahri 19-Sep-13 11:26am View
Yeah I think it's working before I restored my laptop to factory setting and reinstall everything again.
Yes it is in the same project.
Midnight Ahri 18-Sep-13 2:29am View
So am I wrong about the null value?

I'm not sure what you're doing there, but if you use my code above, you can simply add a int variable and +1 it everytime the loop enter the if.

for (int i = 0; i <= this.dataGridView1.Rows.Count - 1; i++)
if ((bool)this.dataGridView1.Rows[i].Cells["ColName"].Value == true)
//your query execution here
x += 1;

Addition :
Save the x variable.
Midnight Ahri 18-Sep-13 2:02am View
FYI, Object reference not set to an instance of an object means something is null.
And I'm refering to "(bool)this.dataGridView1.Rows[i].Cells["ColName"].Value"
If you're still sure everything is not null, then you had to find out where the error occur and what's null there.

If you're saying my code is not working, then you had to find another solution.
My suggestion, put a breakpoint and search for the code that return that error.
Midnight Ahri 18-Sep-13 1:21am View
You had to make sure the cell had value.
Midnight Ahri 18-Sep-13 0:37am View
I changed the solution, "ColName" is the name of your checkbox column.
Tell me if it works.