|
|
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
|
|
|
|
|
Your welcome!
Now, to pertain id to its string, obviously you will create an object that have two properties (id and value) and override the ToString() to display the value.
Ok, now if you use standatd listbox control in windows forms application, all objects that you will append to this control will be displayed using the string retrieved by calling to the ToString() method you just implemented.
This leads you to what we call "CustomEditor".
With CustomEditor you can create your own windows form like application to display and manage the property - so create one with listbox control to retrieve the records from the second table and adding them using the custom object you have just created.
The last section in the mentioned MSDN article discusses this issue.
Best regards, elaj
|
|
|
|
|
Hi. This is probably a basic question, but I haven't been able to find the answer, so if you can help me I'd really appreciate it.
I have the following code:
string postData = string.Format("pi_username={0}&pi_password={1}", m_user, m_password);<br />
byte[] postBuffer = System.Text.Encoding.GetEncoding(1252).GetBytes(postData);<br />
httpReq.ContentLength = postBuffer.Length;<br />
Stream postDataStream = httpReq.GetRequestStream();<br />
postDataStream.Write(postBuffer,0,postBuffer.Length);<br />
postDataStream.Close();<br />
<br />
httpRes = (HttpWebResponse)httpReq.GetResponse();
I'm trying to post this data to the following webpage:
https://secure.globeadvisor.com/gi/db/ga.advisor_homepage[^]
I think part of the problem is that there are multiple forms on this page, and there are 2 Method = "Post". Currently, my error is that I have invalid parameters. Can anyone help me? I'm seriously stuck. Thanks..
Sheri..
|
|
|
|
|
hi...
how i can include help project files (.chm) in my application without need to install the application?
when i start my application (debug or release mode) the help files and folder doesn`t appear in my appplication (Debug\bin dir) folder. that way, i can't use the help files cause they are located in my root solution folder and not in my main application folder (Debug\bin).
i think the case is the same as a project that contains files not used directly by the application, like a image directory (in another project)not included in the resources, for instance.
thanks in advance... :]
|
|
|
|
|
You can use post build commands to copy files to your output directory. Under your project's properties, look for the "Build Events" there are text boxes in which you can enter commands to be executed upon completion of a successful build. I would just use a wild card xcopy to move all chm files, image directories, etc. to the ouput directory.
|
|
|
|
|
Thanks for your answer Jim.
It solved my problem.
|
|
|
|
|
I have been trying to find a way to check file security BEFORE attempting to access a file or folder.
Given the current user and a requested access method, I want to return true or false, whether the user has the given access or not.
With .NET 2.0 I was thinking that this would be provided, but apperently it is not.
Any help appreciated!
|
|
|
|
|
You might be able to put something together using the System.Security.Permissions.FileIOPermission[^] class.
Keep in mind, the best way to do this is to just try and open the file. The security checks are done for you, oddly enough - by this very class, at the time the attempt is made to open the file. So, you're not saving any time by doing this.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi, wise people
I'm not a great programmer, so hope you'll help me.
I need to create transparent(opaque!) control - like a panel with Opacity(0..100) property - which must be transparent not only visually, but also TRANSPARENT FOR MOUSE MOVES AND CLICKS.
Such control - of course is not a top-level window.
Such control - of course must not be under other controls on the window where it is put.
Visual C#, Studio 2005.
Windows 2000, XP or later.
If any ideas, you are welcome. I'll be very thankful.
-------------------------
lalala, I'm from Ukraine
|
|
|
|
|
try the control Visible property.
i think this works - if i have understood your trouble.
cya
|
|
|
|
|
you are a clever guy ) but I need much more - TRANSPARENCY! (OR OPACITY) - WITH CHANGEABLE POWER.
pardon me, I'm from Ukraine, so cant understand differency between transparency and opacity.
So, lets think - your post was just a joke.
----------------------------
lalala, I'm from Ukraine
|
|
|
|
|