|
how can i get a childnode value in a treeview into c# winprogramming.i want to get the child node value in a particular treeview
dcjoshi2
|
|
|
|
|
Here's a simple example to get you started:
TreeNode selectedNodesFirstChild = this.treeView.SelectedNode.Nodes[0];
Just Google it.
Failing that try phoning
|
|
|
|
|
Hi,
If I have some unnecessary Using Statements at the top of my cs code file, will that increase the size of assembly ?
|
|
|
|
|
No, they are ignored by the compiler.
|
|
|
|
|
No, they "only" allow you to use the types from a namespace without the need to specify the whole namespace. So for example you can write FileInfo instead of System.IO.FileInfo .
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
i want to make sth like sound recorder, record the voice and play it .
how could i do ?
|
|
|
|
|
Hi Nafiseh,
I found one complete demo Project in C# somewhere in the internet (I forgot) for Sound recording and playback. It is only 49KB. If there were any option to upload attachment file in this forum, then I could attach that for you.
If you are interested, you can email me from the email Link of this message, I will reply you with the ZIP attachment.
Emran.
|
|
|
|
|
Hi, i too need the same,
Pls send me the zip at pramod.yadav@solversa.com
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
|
thanks,i download some example, but all of them use of some .dll which doesnt work in VS2005.net .
if your sample works on VS2005,i want it. please send me: Salmani.AI@gmail.com
thanks
|
|
|
|
|
|
Hi Emran,
I received the code, that works fine, thanks for that.
Now, one more question,
I want to send the voice over Internet, how do i get the buffer of the sound?
so that i can send that over internet to another connected user.
It would be great if you could send some links or code for the same.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
Hi Pramod,
Nice to hear from you and happy to know that the code is working fine for you.
Ok, as you saw that this project uses QaurtzLib.dll to do all recording and playback stuffs..etc..
As long as this library is not giving you interface to read real time Byte[] Stream, I dont see any way to
buffer the byte[] stream for LIVE transmission. I think you will have to save the recorded file first and then
read the binary file as byte[] stream and transmit over internet.
But another way you can do that (i am not sure if that is an efficient way or not at all..),
You can split the recording process for very short time like sampling and save the voice file and at the same sampling rate
you can read the saved file as byte[] stream and transmit over internet. You can try...
The best efficient way is to look for a library (may be free or commercial whatever you can get) who gives you LIVE byte[] interface
for the recording voice.
Feel free to let me know if this idea helps you or not.
Thanks
Emran
|
|
|
|
|
hi
i urgently need icons(xp style preferred) for add, delete,up and down.
i am unable to find any good one.
can someone please suggest any useful sites.
|
|
|
|
|
|
hello... I need to write a simple chat program and I've noticed that there are alot of sample programs here that use socket programing. Most of them have a client program and a server program which listens to the client program and responds back to it. I also found one peer-to-peer program but here's my question:
How do you connect to the server program (or a client/server) when the server is behind the router or some sort of a firewall. I mean I can't type 192.168.etc. as the ip address! So I was wondering if anybody can tell me how a msn-like chatting program works.
Thanks alot.
|
|
|
|
|
Well, I guess that MSN server has a public IP, apparently you dont have one, so there mainly two solutions:
1. You put on the router somekind of port redirection to your chat server (to the right port of course)
2. You use some kind of VPN software like hamachi (hamachi.cc)
|
|
|
|
|
Hey guys,
Could you help me?? I'm trying to do a simple shift (caesar-like) algorithm. I can get it to shift but once I get to the end of the array, I can't figure out how to return to the first index and keep looking.
Example: plaintext -> abc
shift -> 3
ciphertext -> def
The problem comes when I try to shift one of the last characters in the array any number of positions forward. I get an IndexOutOfBoundsException and all I want to do is start over counting since the first index.
I hope I'm making myself clear.. anyway, here's the code.. thanks a lot!
private void shiftButton_Click(object sender, System.EventArgs e)
{
shiftLbl.Visible = false;
shiftNumber.Visible = false;
shiftButton.Visible = false;
string plainStr = plainTxt.Text;
String myAlphabet = new String(new char[72] {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9','\u0027','\u002E','\u002C','\u003A','\u003B','\u003F','\u0021','\u0023','\u0028','\u0029'});
int shiftNo = Convert.ToInt32(shiftNumber.Text);
for(int i=0;i<plainstr.length;i++)
{
="" for(int="" j="0;j<myAlphabet.Length;j++)
" if(plainstr[i]="=myAlphabet[j])
" ciphertxt.text="" +="myAlphabet[j+shiftNo];
" <b="">/*if(j+shiftNo>myAlphabet.Length)
{
j=-71;//trying to start over in the array
}*/ this commented code is what i'm trying to do
}
}
}
Santinni
|
|
|
|
|
You can do this easily by changing
cipherTxt.Text += myAlphabet[j+shiftNo];
to
cipherTxt.Text += myAlphabet[(j+shiftNo) % myAlphabet.Length];
Thats one of the reasons arrays start at 0.
There are a few optimisations you could do such as using a StringBuilder but if your just interested in the algorithm I wouldn't worry about it.
|
|
|
|
|
thanks a lot, it works when going forward, but not on going backwards...
that is, if I want to decipher it. it works shifting from 'b' to 'a' with a -1 shift, etc. but not from 'a' and back to the end of the array...
I appreciate it
Santinni
|
|
|
|
|
Actually never mind. I just added an if statement saying if shiftNo < 0 then shift+=72
Thanks again!
Santinni
|
|
|
|
|
roberto_santinni wrote: j=-71;
I think that what you are trying to write is:
j -= 71;
---
b { font-weight: normal; }
|
|
|
|
|
I am using a property grid to analyze records from a database. In the case where I have an ID that is the key for a different table, I am wanting to show a drop down list. I have gotten it to work where it will display my object because I've overridden the ToString() method, but when coming back the other way (e.g. selecting a different value in the drop down) it is unable to convert from the string back to the object type that I had). Is there any way to do what I'm wanting? I understand that if all I want is to choose from a list of strings, it would work perfectly, but what I need is to get the ID for that string when it is selected and I need to get the string for that ID when the property drop down is loaded.
Hope that makes sense?
Thanks.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
You should implement your own TypeConverter in order to enable conversion from string type to integer type and vice versa.
Implementing new type converter is an easy job.
Here is a link to very good tutorial:
From MSDN
Another example:
Descriptive Enumarations
|
|
|
|
|
Thanks for the reply. I appreciate it.
I've actually used that document (from MSDN) and gone over the examples there several times and I don't see how you would actually convert from an integer to a string. In the example they give under the heading "Adding Domain List and Simple Drop-down Property Support", you'll see that they are only concerned with string types in the list.
If I could guarantee that my strings are always unique (which, in actuality, they probably won't be), then I could just do a reverse lookup to get the integer back when I need to set a value. The exmple they provide in the MSDN doc gives a good way to use strings, but doesn't seem to pertain to having some different corresponding value than what is displayed in the drop down. Is that the section you are referring to or is there some other part you are talking about?
Thanks again.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|