|
Thanks alot... for the quick reply... well can you please help me a bit more, I have to wait for that process to complete or to close, and have to block the code till the application ends... will be a great favor...
Thanks again.
Regards.
|
|
|
|
|
Process process = new Process();
process.StartInfo = new ProcessStartInfo(fileName);
process.Start();
process.WaitForExit();
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Thanks alot...
God bless you...
Regards,
Waqas.
|
|
|
|
|
XP handles this processing for you if you let it. Just start a process with test.doc as the name.
System.Diagnostics.Process.Start("c:\\test.txt"); will open said text file if it exists.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
I have a receiver connected to the sound card of a computer through the Line In port. Currently, I have some old, unpleasant C++ code that captures the sound to a file locally. What I want to do now is to write some C# code instead that captures the sound off the sound card and uses probably UDP to send packets of the sound data to another computer, which will then play that streamed sound. I need some ideas of how to go about this, if anyone has any helpful suggestions. I would need to know:
1) How in C# to capture sound from the sound card on the system connected to the receiver.
2) How on the other machine to feed the incoming sound packets to ?? DirectSound or Windows Media Player ?? so that the user can hear it as it comes in.
It is not really a constant stream of data, like a streamed radio station (though to be quite honest I don't know how streamed radio stations work either). The user on the second computer chooses which receiver-equipped-computer he wants to connect to in order to receive sound.
I'm basically clueless on the two points above, so I would appreciate any suggestions.
-- modified at 12:52 Friday 14th July, 2006
|
|
|
|
|
ok folks, i am currently using a dataset that pulls data from sql server database and wish to show the results in a label. can someone point me in the right direction or even show me how to do this.
Thanks in advanced
PS: i am building a web application not a windows form.
-- modified at 12:39 Friday 14th July, 2006
|
|
|
|
|
First thing if this is a web app then the APS.NET forum would probably be more appropriate.
Does this dataset contain multiple records or a single result?
label.Text = ds.tables[0].Rows[0][0].ToString();
Or use a databound container such a repeater and create a template that includes a label control.
|
|
|
|
|
What is the best way to move a 8 digit number from a byte array to an int?
This is how I did it:
public void OnReceivedData(byte[] ByteBuffer)
{
//Encoding enc = ;
int myTracking = Convert.ToInt32(ByteBuffer[32]+ByteBuffer[33]+ByteBuffer[34]+ByteBuffer[35]+ByteBuffer[36]+ByteBuffer[37]+ByteBuffer[38]+ByteBuffer[39]);
MessageBox.Show(myTracking.ToString());
}
This there a better way?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Hi, Tom. What does "move a 8 digit number from a byte array to an int" mean? In your solution you just sum up 8 numbers. You even can discard Convert.ToInt32().
|
|
|
|
|
byte[] array = {0x0,0x0,0x15,0x75} = 1964310528 as Int32
however array[0] + array[1] + array[2] + array[3] = 138
byte[] array = {0x0,0x0,0x15,0x75};
MemoryStream ms = new MemoryStream(array);
System.IO.BinaryReader br = new System.IO.BinaryReader(ms);
int abc = br.ReadInt32();
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
There is a better way instead of using MemoryStream.
See this:
byte[] array = { 0x0, 0x0, 0x15, 0x75 };
int abc = BitConverter.ToInt32(array, 0);
|
|
|
|
|
I was just way too lazy to look. (Did I just admit ignorance?) Anyways, I only wrote the code to illustrate the example of the problem of the data of the binary array.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Mind if I ask another Byte array question?
in my code:
<br />
private void WriteRecord(byte[] ByteBuffer, int TrackNumber, string recType)<br />
{<br />
SqlConnection myConnection = new SqlConnection(strConnect);<br />
try<br />
{<br />
String myBuffer; <br />
myBuffer = Encoding.UTF8.GetString(ByteBuffer, 0, ByteBuffer.Length);<br />
MessageBox.Show("My Buffer" + myBuffer);<br />
myBuffer.Replace("'", " ");<br />
myConnection.Open();<br />
SqlCommand myCommand = new SqlCommand("EXEC LA_SP_NYSPINRESPONSE '"+ recType +"', 'P', '"+ myBuffer +"', " + TrackNumber, myConnection);<br />
myCommand.Connection = myConnection;<br />
myCommand.ExecuteNonQuery();<br />
When I try to convert this byte array to a string then display it in a message box, I get nothing. The problem is that in this string there is a single quote i need to remove so that it will write properly to the database. Right now with it comes to that single quote it thinks it's the end of the string and errors out.
So is there a better way to convert a byte array to a string?
Thanks
Tom
Tom Wright
tawright915@gmail.com
|
|
|
|
|
quick question. Using Console.WriteLine I have use the syntax:
Console.WriteLine("my string = '{0}'", new objects[] { str } );
where /str/ gets inserted into the {0} placeholder.
How do I use similar syntax when I'm just building a string to return from a method?
Thx.
|
|
|
|
|
return String.Format("my string = '{0}'", new objects[] { str } );
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
|
This is not an answer but just a recomendation. You can use more simple and more quick way:
Console.WriteLine("my string = '{0}'", str);
|
|
|
|
|
I have an application where a datagrid populates based on a part number. The user can enter new items to the datagrid via dropdown boxes and text fields.
What I want to know how to do, is that if a certain choice from the drop-down box already exists in the database, no longer make it an option in the drop down box.
For example, three types of costs populate in drop down box
Cost 1
Cost 2
Cost 3
User chooses Cost 2 and enters. Datagrid populates and shows the Cost 2 entry.
Now the user wants to enter another type of cost, but there should never be two types of costs for the same part number, so now I want the drop down box to show
Cost 1
Cost 3
Is this possible?
Thanks!
|
|
|
|
|
leckey wrote: Is this possible?
Should be. If you can write a query to produce the database results then add that as a "view" (SQL Server) and bind that to the drop down box. Of course you have to rebind every time the user changes the result of the query.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
Hi guyz,
Im looking for an article or (free) library for creating text effects (like shadows, glass text and so on) and/or the same thing for images/bitmaps.
Unfortunatly I couldnt find anything such this on this board :-/
You know any of this things ? I would appreciate for a answer.
best regards,
Pawel
|
|
|
|
|
|
Thank you very much, that is what I was looking for, strange I couldnt find it myself :-|
Best regard,
Pawel
|
|
|
|
|
Hi,
My client requires the ability to download files from a remote Web server to up to 30 individual client desktop/laptop machines which could be any where in the country. A similar uploading requirement is also being requested.
To understand the WebRequest/Stream issues/handling in C# I have written a standalone Windows Application that successfully streams both data and files from the server that can be saved to the clients hard disk and used as required. I have also produced code that does the uploading process as well.
However all of these are driven from the client machine, ie: the user clicks a button on a client machine, a connection is made with the server and the upload/download process occurs once complete the client closes the connection. I am now moving this process on to use WebServices.
My question is this can WebApplications/WebServices be integrated/designed to allow the following scenario when downloading a file to the client:
1. User browses web pages on normal web site.
2. User sees file they wish to download to their OWN client machine.
3. User clicks link that finds file on server.
4. File streamed into suitable format.
5. Web server then either (i) calls local Web service running on its own machine and this web service is then able to contact the CORRECT client machine to stream the file/data to. Finally the web service on the web server closes the connection with the client. Or (ii) web server is able to call the client machine direct and stream the data/file etc...
[ Note: The upload process will still be driven by the client ]
Can any one advise whether this is possible with .NET..., any issues involved and possible examples/starting points.
I Have asked this on another newsgroup and not received an answer suggesting this is not possible.
Thanks in advance
Andrew
|
|
|
|
|
1-4 are standard procedures involved in downloading a file from a website.
As for #5, it doesn't work that way. It is the client that initiates contact with the server. After all how would the server know which of the millions of machines on the net to connect to?
|
|
|
|
|
Just as always, if this has already been discussed, just point me in the right diirection.
Whenever I try to do my file IO (for any program I've ever done), it turns out that I can also just open up the files in notepad and see (and edit) the contents just fine. I would like help in figuring out how to make my files not human-readable when opened in Notepad. I want to make it so that a user must use my program to modify the files it creates (to ensure the file obeys my file specs).
I'm familiar with the basics of file IO (I generally use StreamReader/ReadLine and StreamWriter/Write for ease and convenience), but I guarantee there are a few people on this forum that know a lot more than me!
-Daniel
Typing too fast fro my owngood
|
|
|
|