|
Your code seems correct (but I don't see it in its whole), so I can't say where your error is...
|
|
|
|
|
the error I get is as follows:
The following exception has occurred:
InvalidCastException: Specified cast is not valid.
Does that help? If not I can put up all the code
|
|
|
|
|
So it means the target instance is not from the type you think it is. In debug mode you could confirm. If you are lost, you could send me a small sample (complete solution, no binaries in the zip file please) to reproduce your issue and I will quickly check. Please use my helpdesk at http://www.visualhint.com/index.php/support/submitrequest/
|
|
|
|
|
Hi,
I retrieved my Outlook Contacts list in a checkedlistbox with only the name and the phone numbers, Now I want to be able to get the phone numbers from the checked contacts from the checkedlistbox to be used somewhere else.
string contName = "";
if (oCt.FullName != null)
{
contName = oCt.FullName;
}
if (chckListBox != null)
{
chckListBox.Items.Add(contName + ", " + PhNum);
}
for(int i=1; i
|
|
|
|
|
I have never worked with the CheckedListBox. Therefore if I needed to solve this problem I would consult the documentation.
|
|
|
|
|
Hello,
I never believe LedMike talking about this "documentaion" stuff.
So I checked it, and have to admit that he is write this time.
There[^] is really a fancy little example which just have to be changed a little to fit your needs.
Have fun reading!
All the best,
Martin
|
|
|
|
|
Thanks
do you know how can set all the items to checked state.
private void btnChckAllOLlist_Click(object sender, EventArgs e)
{
chckListBox.SetItemCheckState = ...
}
I Want to be able to checkall with one button.
Thanks
|
|
|
|
|
Hi,
Trying to convert a string to a hex representation, like so
<br />
string str = "greg";<br />
string hex = "";<br />
foreach(char c in str) {<br />
int tmp = c;<br />
hex += String.Format("{0:X2}", (uint)System.Convert.ToUInt32(tmp.ToString()));<br />
}<br />
which works fine for most characters but when I try feeding in the copyright symbol © (not the html entity © ) I get the hex value A9
Doing the same in PHP I get the value C2A9.
do I need to do something to tell String.Format that the current char is a symbol or something else?
Thanks
Greg
-- modified at 13:26 Tuesday 16th October, 2007
|
|
|
|
|
|
UTF8Encoding ue = new UTF8Encoding();
ASCIIEncoding ae = new ASCIIEncoding();
byte[] bytes = ue.GetBytes("©greg");
foreach (byte b in bytes) {
sb.AppendFormat("{0:X2}", b);
}
bytes = ae.GetBytes("©greg");
sb.Length = 0;
foreach (byte b in bytes) {
sb.AppendFormat("{0:X2}", b);
}
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
The character code for the copyright symbol is 169 (hex A9), so the code works exactly as expected.
What you have done in PHP is not at all the same as what you have done in C#. The byte sequence C2 A9 is not a character code, it's the utf-8 encoding of a string containing the copyright symbol.
To encode a string, use the GetBytes method of the appropriate Encoding instance:
string text = "\xA9";
byte[] data = System.Text.Encoding.UTF8.GetBytes(text);
Now you have an array with the length 2, and the contents { 194, 169 } (hex C2 A9).
---
single minded; short sighted; long gone;
|
|
|
|
|
Trustapple, you really really need to pick up a basic programming book and work your way through it. Granted your questions are getting slightly more complex but seriously - you're still asking similar questions about "functions" that you've been asking for the last day or so!
Trustapple wrote: wen do we create a an object and call the function and wen we can call the function without creating a object.
Put simply, a static method can be called without creating an instance of the object, and an instance method (as is suggested by it's name) must be called on an instance of an object.
|
|
|
|
|
I need a way to get All the records or domains in a NameServer ..
I've red an artice here of C# .NET DNS query component
but it gets all the records for Specific Domain Only ..
Again I need All the Domains or Entrys in this NS
Is that Possible in C#??
Is that Possible using Zone Files??
Is that Possible NsLookUp.exe??
|
|
|
|
|
I'm hesitating to say anything because this can be used for very malicious purposes. What I WILL say is that this is probably not going to be possible on the DNS server you're querying because the server configuration may not let you make such a request. Like I said, ... malicious purposes.
|
|
|
|
|
you're right .. but still there is websites that provide such services
for example "www.domainsdb.net" given the NS it will provide a list of domains contained but the search is limited to 500 results ONLY ..
is it possible to do something like that ??
|
|
|
|
|
Since you don't have direct access to the DNS server, no there isn't. This is because you can give the top level domain as a query and get millions of results. This would bring both the DNS and web server to it's knees processing that many results.
Without direct access to a DNS server that isn't restricted, there's simply nothing you can do unless you get your own DNS server onto the web and can replicate the database of another server.
A query like that is too dangerous to run from an untrusted source. So about the only possible way I can see this happening is if you get your own private copy of a DSN server. Good luck getting that...
|
|
|
|
|
Thanks Dave for ur co-operation ...
but I still have one more question ..
if I have Zone Files actually "I Have it".. can I extract the information i need from it given DNS ??
if yes then how can I Do that ??
Thanks Again ..
|
|
|
|
|
I said this before - I can't tell you. If someone else wants to, that's their responsiblity.
And if you have the zone files for a real world internet DNS server, I don't want to know about it.
|
|
|
|
|
*giggle*
so glad you were 8 minutes faster than me
|
|
|
|
|
Davids Maguire wrote: I need a way to get All the records or domains in a NameServer
From what/where? How do you identify it as a NameServer?
|
|
|
|
|
led mike wrote: From what/where?
do not understand what do u mean ??
led mike wrote: How do you identify it as a NameServer?
it is not a big deal to identify a NameServer ... querying any Whois Server with a range of ips can give u the required NSs there ..
Thanks 4 ur co-operation
|
|
|
|
|
I see you and Dave are discussing this so I will let you guys have at it.
|
|
|
|
|
hi, im new in C#, kindly help me. i want to make a console program using C#.Net 2005 to read a notepad file saved in my drive. the notepad file contains 3 columns i.e. CustNo, X, and Y columns. These columns have many values i mean i dunno how many rows will be there in that notepad file. The rows may be 100, 1000 or 5000 which depends on the file means the rows are not constant.
I want to know the code of it, also tell me what to use. will it b better to use a single array for a single colums or a linked list? or anything else?
CustNo. X Y
0 10 25
1 25 36
2 52 21
3 21 58
4 87 54
5 61 71
6 .. ..
7 .. ..
. .. ..
. .. ..
. .. ..
Kindly help me in this regard. Thanx
nOmI
|
|
|
|
|
nomi khan wrote: I want to know the code of it
Read the first post titled: "How to get an answer to your question". Pay attention to item #2.
|
|
|
|
|
all i can say is sorry
nOmI
|
|
|
|