|
hello please help me to make md4 Hashe in c#.
i Find some codes but not work Correctly.
i want C# code for Make Md4 Hash and me love Summary code
|
|
|
|
|
You do realise that MD4 was smashed like 20 years ago? If this is a new application, I would suggest you use SHA1, or at least MD5. If you really need to implement MD4 to support an older app, MD4 - Koders.com[^] is an implementation that is open source.
Hope this helps.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
yes i want MD4 realy.
but can not run this code
i want real project that can run in computer
|
|
|
|
|
Well, you're not going to get one because, as it's already been said, MD4 has been useless for the last 15-20 years because of its weaknesses. You'd probably be the 20th person on this earth still using it.
|
|
|
|
|
i understand md4 is bad is very bad but i nescery md4
|
|
|
|
|
Presumably someone told you to do it that way for business need.
If so I would research the relevant problems with that and then present that to that person and insist that they sign off on that document themselves and then you keep a record of it. That way when (not if) a problem occurs you are in the clear.
|
|
|
|
|
Hi !
Is There Help to Find the Maximum Value in A Row of A DataGridView .
Thanks In Advance !
|
|
|
|
|
No.
A DataGridView just holds Columns, it does not assume those Columns hold data types that are comparable amongst themselves.
|
|
|
|
|
You'll have to teach it how.
|
|
|
|
|
who's a good datagrid, here have a nice treat
|
|
|
|
|
DataGridView was not designed for data manipulation.
I would suggest you write an SQL query or Stored procedure that uses the MAX function and then call it with the Command.ExecuteScalar() method.
|
|
|
|
|
Quote:
You'll have to teach it how.
Yes , You are Right !
in fact I shouldn't to use any database , otherwise , it was simple than i want to do this now !
in any case I should do it with help u !
Regards !
|
|
|
|
|
Hi all! I am creating tab pages and adding them to a tab control. When setting the text for a tab page, the part of the tab page where the text is shown always stretches to show the full tab page title. But some of the titles are very long and would like to know how I can limit the width of the part of the control where the title is shown so that not all characters will be shown. I think this will enable the tab control to show more tab page titles at a time. Thanks in advance.
|
|
|
|
|
In a TabControl the functionality of the tabs themselves is very limited.
You have basically two choices:
1. create your own TabControl, giving you lots of headaches and full control.
2. modify the TabPage texts in accordance to the page being selected or not (that is what I would do). You could store the long and short texts in two separate Dictionary<TabPage,string> collections, and use the SelectedIndexChanged event to apply them.
|
|
|
|
|
Here's the way I would approach this: assuming this is WinForms: and, assuming that I wanted all the tabs to always maintain a certain short length
... of course Luc's excellent solution (above) would work great if you are willing to change the width of the TabPage Tab header text when each TabPage is selected ...
1. on the TabControl: set the 'ShowToolTips property to 'true
2. for each Tab:
a. define a short, hopefully mnemonic, name for the Tab
b. set the ToolTipText for that Tab to the longer name
3. fill each TabPage with a Panel with its 'Dock property set to 'Fill
Discussion: The Panel that fills each TabPage will not show a ToolTip, but mouse-over the Tab will show the "long name."
One step further using this suggestion: I suppose if I had a lot of Tabs ... or for future flexibility in revision/maintenance ... I might "automate" this by creating two matching Lists, or a Dictionary, and then, in the Form's 'Load EventHandler, doing the right thing to set each TabPage's 'Text and 'ToolTipText properties in a loop.
The Occam's Razor solution: Perhaps the simplest, idea of all, if you are willing to use the content area of the TabPage: put a label somewhere on each TabPage showing the full-name.
Thinking out-of-the-box: create a UserControl that joins a TabControl with a StatusStrip control, and show the full name, and whatever else, in the StatusStrip for each selected TabPage ?
"... Sturgeon's revelation. It came to him that Science Fiction is indeed ninety-percent crud, but that also—Eureka!—ninety-percent of everything is crud. All things—cars, books, cheeses, hairstyles, people and pins are, to the expert and discerning eye, crud, except for the acceptable tithe which we each happen to like." early 1950's quote from Venture Sci-Fi Magazine on the origin of Sturgeon's Law, by author Theodore Sturgeon: source Oxford English Dictionary on-line "Word-of-the-Day."
|
|
|
|
|
Hi All !
Is it possible to Naming "Row" of A DataGridView as a Column "Header Text" .
Thanks a Lot !
|
|
|
|
|
I'm not sure what you mean, but how about System.Windows.Forms.DataGridViewRowHeaderCell.Value ?
|
|
|
|
|
yes , but Not For Rows , I don't think exist any property for Row to put a Text !
Thanks !
|
|
|
|
|
Then explain more clearly what you want.
System.Data.DataTable dt = new System.Data.DataTable() ;
for ( int col = 0 ; col < 10 ; col++ )
{
dt.Columns.Add ( new System.Data.DataColumn ( col.ToString() ) ) ;
}
for ( int row = 0 ; row < 10 ; row++ )
{
System.Data.DataRow dr = dt.NewRow() ;
for ( int col = 0 ; col < dt.Columns.Count ; col++ )
{
dr [ col ] = row * col ;
}
dt.Rows.Add ( dr ) ;
}
this.dataGridView1.DataSource = dt ;
for ( int row = 0 ; row < dt.Rows.Count ; row++ )
{
this.dataGridView1.Rows [ row ].HeaderCell.Value = row.ToString() ;
}
This gives me a DataGridView showing a multiplication table with the row headers showing the row number.
|
|
|
|
|
thanks for Ur Help , I wanted To give A Name for Each Row , that stored in a Combo Box !
|
|
|
|
|
How about you adding a DataGridViewColumn which would then hold the names you choose?
|
|
|
|
|
Hello all,
I am currently handling very large images, which are basically generated by stitching together many smaller images (e.g. panorama or photo mosaic software). In order to avoid out-of-memory exceptions (in memory are only "maps" of how to arrange the smaller images), I wrote some code saving these images line by line as bitmaps using BinaryWriter and LockBits. So far, so good.
The problem is now that I would like to save these images as Jpegs (or PNGs) as well. Since I am pretty new to c# I can only think of two ways for now:
1) Similar to the bitmap saving procedure. Generating some jpeg header and saving the big images line by line, compressing them somehow before. I have no idea how to perform the compression though.
2) Streaming the already saved bitmap into the memory and saving it as encoded jpeg.
Since the second approach seemed easier, I tried something like this:
FileStream fsr = new FileStream("input.bmp", FileMode.Open, FileAccess.Read);
FileStream fsw = new FileStream("output.jpg", FileMode.CreateNew, FileAccess.Write);
EncoderParameters encoderParameters = new EncoderParameters(1);
encoderParameters.Param[0] = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 80L);
Bitmap bmp = new Bitmap(fsr);
bmp.Save(fsw, GetEncoder(ImageFormat.Jpeg), encoderParameters);
bmp.Dispose();
The problem is now that the save-method tries to completely load the bitmap into memory first, causing an out-of-memory exception.
I would be more than happy for any suggestions on how to solve or circumvent this problem!
Cheers,
Max
Update: I now edited the code so that it saves bands of 8 lines as bmp. These bands I would now like to save to the same jpeg file - any ideas?
modified 24-Nov-11 8:04am.
|
|
|
|
|
|
Well, that's what it does. A third party encoder may be worth looking into, or you can roll your own. PNG is pretty easy to encode in a streaming way (the Deflate step obviously requires a buffer, but a constant-size small one). JPG of course can't exactly be encoded line-by-line, but block by block isn't any worse.
|
|
|
|
|
You can't get decent JPEG compression for images with insufficient height, the DCT step in the JPEG compression algorithm is using pixel blocks of 8 by 8 pixels. Any less will fail terribly.
Are you sure you are actually running out of memory? How many elementary images are there, and what is their size?
The reason I ask is GDI+ tends to be pretty confusing with its error messages, e.g. when Image.FromFile() says "out-of-memory" it really means "this is an image format I don't understand". See here[^].
|
|
|
|