Ok debug your code, put a breakpoint on "ipadd = Convert.ToInt32(st);" and watch the value of st and stl. You may be in for a surprise.
To solve this problem.. just start using SelectSingle on an XmlDocument. It's at least 10 times as easy to get right.
As to specifying the ip/port in the client - the exact same way you did it in the server will do fine.
i am reading datas in text file and write into another text file..but getting exception ...
FileStream fs=new FileStream("C:\\Vicky\\DATAS\\1.txt",FileMode.OpenOrCreate,FileAccess.Write);
StreamWriter sw = new StreamWriter(fs);
FileStream fs1 = new FileStream("c:\\one.txt", FileMode.Open, FileAccess.Read);
StreamReader sr = new StreamReader(fs1);
string s = new string;
for(int i = 0; i <= 500; i++)
s[i] = sr.ReadLine();
An array is 0 based. So if the array contains 500 elements the first has index 0 and the last 499. In your for cycle (with <=) at the end you were trying to access to the element with index 500 that obviously is outside the bounds of the array.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Luc Pattyn [Forum Guidelines][My Articles] - before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
i'm trying to connect to the Deleted objects container in AD by using:
DirectoryEntry de = new DirectoryEntry("LDAP://CN=Deleted Objects,DC=domain,DC=com")
and it is retuning with an error saying - There is no such object on the sever. but i can see it when i use LDP!!
there is this thing called a book... In it they have examples and tell you how to do things. Plus if you want to make life hard for yourself with out using enterprise manager you should be able to do this yourself!
I have a simple question for C# masters concerning controls.
I have a series of label with a formated name.
In a loop, I want to recover a pointer on the control (a label) by giving its name as a string.
Label lbl = null;<br />
string lblName = "";<br />
for (int i=0; i<5; i++)<br />
lblName = "lblL" + i.ToString(); // lblName will contain "lblL0", "lblL1" etc.<br />
// here is what I'm looking for...<br />
lbl = ???; // the label is supposed to point on the label with the built name contained in the variable lblName.<br />
// now the lbl variable points on the right control with name given by the variable lblName<br />
lbl.Text = i.ToString();<br />
How to make the control pointing to the right one given its name?
I hope you understood my question in my poor english.