|
Hello,
is there a way to retrieve basic information about a certain volume like a CD-ROM or harddrive?
Such attributes like
Size
free space
serial number of the current volume or harddrive
and so on
I'd prefer a way that does not need any C++ or delphi dll's
Is there no Class in C# that provides such information.
Thanks for any help,
Sören
|
|
|
|
|
|
thanks a lot.
I guess this will solve my problems.
|
|
|
|
|
By default when I search a String in another String its case-sensitve(Using String.IndexOf() ),How can change it to case-insensitive?
Mazy
No sig. available now.
|
|
|
|
|
|
This does not work on all cultures.
For example, in the Danish language, a case-insensitive comparison of the two-letter pairs aA and AA is not considered equal. In the Vietnamese alphabet, a case-insensitive comparison of the two-letter pairs nG and NG is not considered equal.
For more information, see the topic "Culture-Insensitive String Operations" on MSDN.
Help me dominate the world - click this link and my army will grow
|
|
|
|
|
|
s1.ToLower().IndexOf( s2.ToLower() )
|
|
|
|
|
I usually use a System.Text.RegularExpression object with the
RegexOptions.IgnoreCase option applied. Here's an example of a string replace function I use for this:
private string CaseInsensitiveReplace(string sMain, string sReplaceThis,
string sWithThis)
{
return Regex.Replace(sMain, sReplaceThis, sWithThis,
RegexOptions.IgnoreCase);
}
You could use the Match method of a Regex object to perform a find.
|
|
|
|
|
Hi,
I was experimenting on the printing functions and found out you can get a lot of information about a printer trough System.Drawing.Printing.PrinterSettings. But I'm missing the minimum margins where the printer can print.
Most printers can't print to the edges of a page. These margins varies for eacht printer. Where can we find this information?
The Margins class allow to set margins, but it doesn't get the minimum margins of a specific printer. What I need is really the margin where a printer can't print.
For example a HP OfficeJet d155 minimum margins are
Left: 0,34 cm
Right: 0,93 cm
Top: 0,00 cm
Bottom: 0,67 cm
How can we get this information in .NET (maybe in pixels or inches)?
thx
|
|
|
|
|
I was able to add 15,000 strings to a list box in C# about 3 times faster than using MFC. It makes me wonder if .NET uses virtual list boxes. Anyone know?
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
I added half a million (424,379) and it took roughly about 5 minutes....
How long did yours take?
/\ |_ E X E GG
|
|
|
|
|
The 15,000 items took about .1 seconds in .NET. My original test was taking .35 seconds in MFC/C++. After some work, the tests on a different, slower, system took .2 seconds in .NET and .4 seconds in MFC.
Do note that on additions as large as yours, paging starts affecting performance.
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
for(int i=0; i<data.Length; i++)
{
logForm.listBoxLog.Items.Add(DateTime.Now.ToString("hh:mm:ss:ff")+": ["+data[i].ToString()+"]");
}
and i'm guessing that the "DateTime.Now" is slowing it down too, correct?
/\ |_ E X E GG
|
|
|
|
|
Probably not as much as you might think. The DateTime functionality will be paged in and in such a tight loop may be entirely in the CPU secondary cache. In smaller amounts, the memory allocator in .NET is more efficient than that in C++, but I've already accounted for that by testing with preallocated objects.
Of course adding a hundred thousand items to a list box is generally a bad idea, thus the question as to whether the .NET box is a virtual box.
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
|
Use an obfuscator. VS.Net 2003 comes with one.
|
|
|
|
|
|
Yeah, what he said
|
|
|
|
|
Xarx wrote:
Anyway to stop programs from being decompiled?
The most common way is to use an obfuscator. Obfuscators change the names of the members in an app so that the person decompiling it can;t as easily make sense of it (which is easier to figure out the meaning of: "CustomerListView.AddItem(...)", or "Member25.Member33(...)" ?). There's one that comes with VS.NET, but if you're doing serious work, you'll need a more advanced version.
Another way is to compile the executable into native code. There's an app, .NET Protector[^], that does this for you.
Xarx wrote:
i was able to decompile most of WebMatrix
Hmm... could you send me the code? Just kidding, but I would like to know how they show ASP.NET controls in the HTML designer.
|
|
|
|
|
Is there something like .NET Protector that is free by any chance?
Thanks!
|
|
|
|
|
I wish there was...
|
|
|
|
|
jdunlap wrote:
Another way is to compile the executable into native code. There's an app, .NET Protector[^], that does this for you.
Am I missing something or does this look like a glorified ngen?
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?"
-Hockey on being a geek
|
|
|
|
|
David Stone wrote:
Am I missing something or does this look like a glorified ngen?
Well, ngen creates native images, but those images unfortunately cannot be transferred to another computer.
|
|
|
|
|
jdunlap wrote:
but those images unfortunately cannot be transferred to another computer.
Are you sure about that? I was under the impression that they could...
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?"
-Hockey on being a geek
|
|
|
|