|
|
"It worked!" ?
This seems funny to me, because it implies that closing a file after writing to it is some kind of clever trick or technique as opposed to what you should always do.
BTW, this sounds like something you might want to do with a script (Python or Ruby, or (if you must) Perl, etc.).
Matt Gerrans
-- modified at 22:03 Friday 21st October, 2005
|
|
|
|
|
|
I have a .bmp file and I need to do it SplashScreen for my form.Anybody can tell me how to do it?
|
|
|
|
|
hi there,
I'm pretty sure that there are a lot of articles about this on CP site.
below is just one of them
Splash Screen
Hope this helps
<< >>
|
|
|
|
|
Take a look at these articles:
http://www.codeproject.com/csharp/PrettyGoodSplashScreen.asp
http://www.codersource.net/csharp_splash_screen.aspx
André
|
|
|
|
|
i make a correct cryptostream object and make the while loop that is in msn example but when i call .close() method it write correctly (i guess) the file crypted infact i can see it on my HD and it is crypted (it is a kb bigger the origina) but i get the following exception:
The lenght of the crypted file is not correct.
What does it mean? where could i wrong?
|
|
|
|
|
Hi,
Can Any one can tell How to read data from the flat files(txt files) to DataSet
Thanks and Regards,
Subbu
|
|
|
|
|
what do you mean, dataset is simple, which take string/int values , just break the file and write to dataset in the required column's, do you need a sample code.
|
|
|
|
|
use the text ole db provider.
|
|
|
|
|
Hi Everybody!
I have to make a program which works on XML files.
I need to know how to read/write in these files.
Anyone know an easy guide?
I dont need to know all about it, only how to write/read and the main notions.
Thank You
Enrico
|
|
|
|
|
go to Google.com
Search for "Xml c#"
Tons of info.
http://www.functionx.com/csharp/xml/Lesson01.htm Just one of many
*****************
"We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW
-- modified at 13:41 Friday 21st October, 2005
|
|
|
|
|
the best way to deal with XML's in C# is using Dataset's.
they are very easy to implement.
|
|
|
|
|
what do you mean for Dataset's?
|
|
|
|
|
Hi,
How do you capture Key Press Events on a WinForm? I would like to setup Function Keys to fire events and I'm not certain where to start. Any help would be greatly appreciated.
|
|
|
|
|
refer to user32.dll , import this DLL and you can capture all the key events
|
|
|
|
|
Can't you just set them up as accelerators for a menu or a toolbar?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
if i have a serialized struct object with these information:
bitmap
string
string
byte[]
can an hacker load the serialized file and see these information that is get the bitmap file, the strings...
Also:
if i've an .exe with embedded a bitmap, can he get the bitmap?
|
|
|
|
|
The answer is yes to both questions. If your software can use the object or bitmap, so can anyone else through debugging and reverse engineering.
The only effective way to prevent this would be to encrypt your sensitive content and have the decryption key entered by the user. Having the software automatically decrypt the content with a key contained inside the software or system itself is no different than the original situation because anyone can just follow along and wait for your software to decrypt the content on its own.
|
|
|
|
|
How much time do you think the hacker is able to get the key within the .exe and decrypt the file?
|
|
|
|
|
I have windows forms application, where user can select images to be loaded from FileDialog. It creates thumbnails of those and displayes them in listview...its taking longer then expected. Users generally select 30-35 200DPI .jpeg images. I am using Imagelist & Listview combination....I think problem is of windows painting(invalidate or refresh)...I do beginUpdate,endUpdate before and after adding items.
How can i boost performance of this task?
Any help will greatly be appriciated..
Regards,
MaulikCE
|
|
|
|
|
1. Make sure all your images already contain an embedded Thumbnail image
2. Only load those images in the visible area (in other words, don't load them all, only what the user can see on the screen)
3. Thread it so the loading process doesn't "tag" your window
|
|
|
|
|
You have to save your thumbnail images and just load them next time except shrinking the original images again and again.
Thumbnails can be stored in some pre-defined directory with hashed filenames. I have developed such very standard system of storing thumbnails based on MD5 hashing. It works this way:
1. Check if the image is small enough (no need to create thumbnail => return)
2. Create MD5 hash from image's FULL path (C:\My Documents\Pictures\ ...)
3. Look to your Thumbnails directory, if there is a thumbnail created
3.1 Yes, load thumbnail
3.2 No, create thumbnail and save it in Thumbnails directory
This is my method for generating MD5 from path string (it returns MD5 in hex format):
<br />
using System.Security.Cryptography;<br />
using System.Text;<br />
<br />
...<br />
<br />
protected string HashPath(string path) {<br />
<br />
ASCIIEncoding enc = new ASCIIEncoding();<br />
MD5 md5 = MD5CryptoServiceProvider.Create();<br />
<br />
byte[] buffer = md5.ComputeHash(enc.GetBytes(path));<br />
string hashPath = "";<br />
<br />
for (int i = 0; i < buffer.Length; i++)<br />
hashPath = hashPath + String.Format("{0:X2}", buffer[i]).ToLower();<br />
<br />
return parentPanel.hashDirectory + hashPath + ".jpg";<br />
}<br />
...and of course, optimize your code of thumbnail creation. Use fast GDI+ filters for resampling images and put it all on background separate thread.
Hope this helps
|
|
|
|
|
How to check if the string can be a valid XML element name?
In other words, I'm looking for this kind of function:
<br />
bool XmlValidate(string name);<br />
<br />
XmlValidate("RightElement" );
XmlValidate("2 Wrong ,@# Element");
|
|
|
|
|
I'm not sure about a validate function, but you could do it this way:
using System.Text.RegularExpressions;
.
.
.
// reg ex to validate an XML element name
Regex reg = new Regex ( @"^(?!xml)[a-zA-Z]\w+$", RegexOptions.IgnoreCase );
if ( reg.IsMatch ( "STRING TO CHECK" ) )
{
// do something with it
}
I did not verify the regular expression string against all possible errors (malformed element names), but you should be able to correct any mistakes or add characters that you want to be valid. I don't like to use anything other than what is already there.
Hope this helps
|
|
|
|