|
Have a look at DBMon. It was an SDK tool with source code back in the day.
It can be downloaded here[^] or you'll probably have it in your platform sdk installation.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
|
Is there any way that I can start with a 2-character string, and find out if that is a valid 2-Character, ISO code for a localized language? For example, I have 'es' and I want to know that this is valid because it is the 2-character code for spanish. But 'oh' is not a valid language code.
There are 10 kinds of people in the world.
Those that read binary...
...and those who don't.
|
|
|
|
|
System.Globalization.CultureInfo.GetCultures();
Loop though the cultures and see if you find the two letter ISO code.
Obviously the two letter codes are not enough to identify a language, so be careful what you do with it.
|
|
|
|
|
Hi all,
I have a DataTable object and the 4th column has DateTime objects stored in it.
To get at the DateTimes i am doing the following.
DateTime dt;<br />
<br />
for (int x = 0; x < Table.Rows.Count; x++)<br />
{<br />
dt = (DateTime)Table.Rows[x].ItemArray[3]<br />
.....<br />
Some other code here<br />
.....<br />
}
Is there any way of getting at the DateTime object in the column without casting?
This is my biggest overhead by far in the method which is fine for a few hundred iterations
but sometimes i am going through tens of thousands of iterations and it's a tad slow.
Anyone able to help??
Cheers
Kev
|
|
|
|
|
When using the DataTable you will have to do the casting. One solution would be to take another data structure. You should also try not taking the ItemArray property as I think it produces a bit overhead (Im not 100% in this):
DateTime dt;
for (int x = 0; x < Table.Rows.Count; x++)
{
dt = (DateTime)Table.Rows[x][3]
.....
Some other code here
.....
}
|
|
|
|
|
Say someone wanted to write an application that would get the ip address, like an IP Updater. I have found various examples on the how-to of getting this information using the .NET dns class but here is the problem - how do you get the public ip address of a machine when it is behind a router? The using of the .NET dns class, in my experience, will retrieve the local ip address, thus the 192.168.1.X address, not the public ip address of 66.xxx.xxx.xxx. How can I retrieve the public ip address?
|
|
|
|
|
|
Your machine doesn't have a "public" IP address. It only has the address assigned by your router.
Like leppie said, you can use an Internet webservice or website that tells you what your routers WAN address is because it's your router that make requests for your machines, kind of like a proxy. The address returned will be the same for all computers on your network because the address doesn't belong to any one machine, it belongs to the WAN side of your router, or you can think of it as your network's address.
Or, you can use the hostname and domain that was assigned to you by your ISP, if available (check your paperwork) and DNS resolve that.
Another option would be to query your router for that information. You can either write yourself an automated Telnet client that talks to the router, or your could write up something to do it through the routers web interface. Either way, the code you write will be specific to YOUR router. It won't work with all manufacturers because each one uses a different interface. For example, the code that works on getting the WAN address for a D-Link router won't work with a Linksys router.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a problem. But on .NET 1.1
My Scenario:
Actually I will have a string of hexadecimals read from a xml file. Then from the hexadecimals, i will add 1 value whenever i made any modifications. But just i do not how to get started. It is like an incremental hexadecimals.
I have a string of hex.
string strHex = "0100000000FF";
I want to convert this Hex to decimals, just like the windows calculate, when you type FF in Hex and click on Dec radio button, it will change to 255.
I tried string.Format("{0 }", strHex);
I tried Convert.ToDecimal or Convert.ToInt64
But i still cannot find a solution?
----
I know how to convert long to hex. Like this.
for (long x = 000000000000; x <= 281474976710655; x++)
{
Console.WriteLine(string.Format("{0:x12}", x));
Console.ReadLine();
}
But i do not know how to do the opposite? Anyone can help me please?
Thanks.
Regards,
Chua Wen Ching
Visit us at http://www.necoders.com
|
|
|
|
|
You need to manually loop through your Hex string, a byte at a time and convert it to decimal. Like this
byte []hexValues = new byte[text.Length /3 + 1];
int index = 0;
for (int i = 0; i<text.Length; i += 2, index++)
{
string currentHexValue = text[i].ToString();
if ( i + 1 < text.Length)
currentHexValue += text[i+1].ToString();
try
{
hexValues[index] = byte.Parse(currentHexValue, System.Globalization.NumberStyles.AllowHexSpecifier);
}
catch(Exception)
{
if (currentHexValue == "00")
return new byte[] {0};
else
}
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
hi
how i can embed clinet side script code in web date grid control with
C# .NET ?
thanx
|
|
|
|
|
hi
i want to use java script files to store data in client computer
like google's gmail mechanism for auto complete and speed matter.
but i don't know how i can hide this file(which containes user data) from
hackers just like gmail(i can't find gmail data in my computer and i can't save gmail page correctly to see my data stored in some files!)
how gmail does it? and how i can prevent jscript file saving request from user?
i'm wating
thanks
|
|
|
|
|
Hey
I created an application that uses the DocumentComplete event.
on my computer it works great, but on 2 other machines I checked my program it does not work, and completly ignores the event.
I checked the automation article's tutorial demo, that uses the same event (great article by the way!), and the same problem appears again! on my computer it works great, but on 2 other it does not, and completly ignores the event.
ANY IDEAS ANYONE????
Thanks alot!
|
|
|
|
|
hi
i want to use java script files to store data in client computer
like google's gmail mechanism for auto complete and speed matter.
but i don't know how i can hide this file(which containes user data) from
hackers just like gmail(i can't find gmail data in my computer and i can't save gmail page correctly to see my data stored in some files!)
how gmail does it? and how i can prevent jscript file saving request from user?
i'm wating
thanks
|
|
|
|
|
So, how can I browse my computer and select more than 200 files for the application?
|
|
|
|
|
There's more information about the problem in this[^] MS KB article. This is a limitation of the underlying unmanaged API, not the .NET wrapper class.
If you want to select more than 200 files, you'll have to design your own OpenFileDialog box.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I also think about this. But when you do it, you can only do a little work, for example change 200 files to a larger number and remove unneccessary funtionalities, and what remain is VS.NET's work.
How do I get start?
|
|
|
|
|
No, you can't do that. You must write your own OpenFileDialog from scratch.
You can't change the existing dialog because the problem is NOT within the .NET Framework OpenFileDialog class code. The problem lies within the underlying Windows control, which you cannot change, that the .NET Framework OpenFileDialog class wraps.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i've the last nodes of a treeview that rappresent a bitmap image.
I need by dragging one of these node to show a preview (50% smaller and semi-transparent) of the bitmap of referring that follow my cursor (just as a drag effect)
How can i realize this effect?
|
|
|
|
|
I have the following code:
FolderBrowserDialog folderDlg = new FolderBrowserDialog();
folderDlg.RootFolder = Environment.SpecialFolder.MyComputer;
folderDlg.ShowNewFolderButton = false;
folderDlg.Description = "Select the folder";
folderDlg.SelectedPath = strPath;
DialogResult result = folderDlg.ShowDialog();
if( result == DialogResult.OK )
{
}
However, when the FolderBrowserDialog is shown, the initial folder is not set even though SelectedPath property is used as above. Similar experience is noticed by me in some other code on similar occasions as well. In fact, in this situation, there is some other abnormality as the OK button is shown enabled for My Computer folder also which is not so when this property is not set. On the other hand, if I set the SelectedPath property as something like @"C:\Program Files\", then it is correctly shown.
What can be the reason? Am I missing something?
|
|
|
|
|
I think the FolderBrowserDialog class has a bug with paths with more than 256 chars. Might this be the cause?
|
|
|
|
|
Hi every body , from a few days i have a problem that i can't solve , how i can pass a STRING variable by using a matlab program dll .
The document 1,2,3 ways offer just a double variable
Plz i need it ,
thx
|
|
|
|
|
hi..
please ...please i neeeeeeed help about how the fixed(clean)for viruse will done in c# or java
please if any one have information about this subject pleeeese help me
423423
|
|
|
|
|
hi..
please ...please i neeeeeeed help about how the fixed(clean)for viruse will done in c# or java
please if any one have information about this subject pleeeese help me
|
|
|
|