|
I need to create a empty sound wave file. I do it like this now.
System.IO.File.Create("test.wav")
This test file has zero bytes.
But the program I am using can't record to it. Says somthing like file type not recognized.
However if I use explorer and right click new - new wave sound, The program can record to it ok.
This one created by explorer has 1k bytes.
How can I programicly create a "formated?" wave file like explorer?
-- modified at 11:40 Tuesday 6th December, 2005
|
|
|
|
|
|
I would create a wav file in explorer and figure out what data is in it (by reading it into an array, for example). Then whenever you want to create a wav file, you just have to write out those bytes. You will probably want to bury the header bytes for a "blank" wav file as a resource in your application so you dont have to worry about keeping an empty file around that could get accidentally deleted.
|
|
|
|
|
Hey everyone, my name is Vik. I'm foreign young school student n i jus started learnin programing. I got 5 pictures to load in a picture box, "next" and "previous" button. Got no idea how i can implement it, can someone please give me a bit of help.
in old VB i could write path for a fil in this form "me:\pic\example.gif", it doesnt seem to work in VB.Net,can anyone tell me what is a way for doin this?
Thank u,
Vik
|
|
|
|
|
picturebox.Image = System.Drawing.Image.FromFile("C:\path\as\string.here")
Geronimo
|
|
|
|
|
Hi!
I have a created a windows service. Now I'm writing an application that monitors this service. I want the application to display a NotifyIcon in the system tray. Also I want the service to start the monitoring application if it's not already running.
If I start the application on it's own everything works fine. I can see and intercat with my icon, but if the service starts the application I can see the process running in the Task Manager but the system tray icon is missing.
Any ideas?
|
|
|
|
|
It's missing because the service started the monitoring application on the wrong desktop. Service run under their own desktop, not the one you see when you log in.
You might want to try going into the Service manager, getting properties on your service, click the LogOn tab, and check the box that says something like "Allow service to interact with desktop".
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yes, I guessed that it was something like that.
When the service is starting the monitoring application they both run as SYSTEM in the task manager. I've tried to set it to allow interaction with my desktop, as you proposed, with no result.
I also tried to allow the service to run as my user account. Now both the service and the monitoring application is running as my local user in the task manager but still no system tray icon?
|
|
|
|
|
I was afraid of that...
The easier method is to not create the monitor process from the service. This is because the service will run without a user being logged in, and hence, there's no desktop to start the process on anyway.
You can use .NET Remoting to get status information from your service. Start the manager application out of the Run key in the Registry. This will start the monitor whenever a user logs in. This monitor can then contact the service over Remoting and get status information and updates through events over Remoting. Then the monitor can put up the icon in the Tray without any desktop problems.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
HI Gurus. I am trying to generate a Table with dynamic controls in different
cells. I am at the same time generating Validation controls and assigning
"control to validate" property to the ID of the generated controls. The
generation works as expected, however when I press the submit button,
validation controls do not react. I posted the code below for the entire
table. In the last line I add the table to a session and regenerate the table
in the Page_Init between postbacks. Can anyone suggest why the validation
does not fire? BTW the "Causesvalidation" property of the submit button is
"ON". In advance, many thanks.
For counter = 0 To CInt(qty - 1)
tRow = New HtmlTableRow
tRow.ID = "fltRow" & counter
'mile cells
tCell = New HtmlTableCell
tCell.ID = "cellMile" & counter
tCell.Width = "20px"
txbMile = New TextBox
txbMile.ID = "txbMile" & counter
validator = New RangeValidator
validator.ControlToValidate = "txbMile" & counter
validator.Type = ValidationDataType.Integer
validator.MinimumValue = txbStartMile.Text
validator.MaximumValue = txbEndMile.Text
validator.Text = "*"
validator.ErrorMessage = "The value must be between " &
txbStartMile.Text & " and " & txbEndMile.Text
txbMile.Width = New System.Web.UI.WebControls.Unit(30)
tCell.Controls.Add(txbMile)
tCell.Controls.Add(validator)
tRow.Cells.Add(tCell)
'chain Cells
tCell = New HtmlTableCell
tCell.ID = "cellChan" & counter
tCell.Width = "20px"
txbchain = New TextBox
validator = New RangeValidator
validator.Type = ValidationDataType.Integer
validator.ControlToValidate = "cellChan" & counter
validator.MinimumValue = txbStartYards.Text
validator.MaximumValue = txbEndYards.Text
validator.Text = "*"
validator.ErrorMessage = "The value must be between " &
txbStartYards.Text & " and " & txbEndYards.Text
txbchain.Width = New System.Web.UI.WebControls.Unit(30)
txbchain.ID = "txbChain" & counter
tCell.Controls.Add(txbchain)
tRow.Cells.Add(tCell)
'fault Cells
tCell = New HtmlTableCell
tCell.ID = "cellFault" & counter
tCell.Width = "80%"
' validator = New RangeValidator
txbFault = New TextBox
txbFault.ID = "txbFault" & counter
recValidator = New RequiredFieldValidator
recValidator.ControlToValidate = "txbFault" & counter
recValidator.Text = "*"
recValidator.ErrorMessage = "Please add the fault"
txbFault.Wrap = True
txbFault.TextMode = TextBoxMode.MultiLine
txbFault.Width = New System.Web.UI.WebControls.Unit(400)
tCell.Controls.Add(txbFault)
tRow.Cells.Add(tCell)
'add created row to the table
tableFaults.Rows.Add(tRow)
Next
tableFaults.Width = "100%"
tableFaults.Border = "1"
tableFaults.ID = "tblFaults"
pnlFaults.Controls.Add(tableFaults)
Session("tableFaults") = tableFaults
Phillie
|
|
|
|
|
Hi all,
How to determine the line number and the column number of Notepad acoording to the posion of the cursor/caret.
Thanks And regards
Samik Karmakar
Samik
|
|
|
|
|
Hi all,
How to determine the line number and the column number of Notepad acoording to the posion of the cursor/caret.
Thanks And regards
Samik Karmakar
Samik
|
|
|
|
|
Basically, you can't. Notepad doesn't expose any such API.
In theory, you could probably calculate it, but you would have to get the text from the textbox in Notepad, get the font that it's using, get the window dimensions, and get the status of the Word Wrap option. Not at all easy from your application, since Notepad doesn't support plug-in's.
Then you'll have to calculate the length of a line, using the Word Wrap status, window dimensions, font size, ..., yada, yada, yada, ...
It would be easier if you just wrote your own Notepad! Start with a TextBox on a form...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi guys.
need some help
i have created a window service with connects to sql 2000 as insert some records after every 30 min. the service is working fine but the problem is that it is consuming a lot of memory. can any one tell me how to reduce that consumption of memory. i m thinking to change the process priority will it help
or there is some other solution.
bi
abhinav
|
|
|
|
|
If your looking in TaskManager, then your looking in the wrong place to see how much memory your app is actually using. What your seeing in the memory RESERVED for the .NET runtime, or virtual machine, that your app is running inside of. This, by no means, is an indicator of your app keeping a stranglehold on that memory. The .NET Memory Manager will release any memory back to the system that Windows needs for other things.
And, no, changing the process priority will have no effect at all on that processes memory consumption.
Basically, there's nothing to do to get the memory footprint down. Just let the Memory Manager do it's job.
Now, that, of course, assumes that your code is written properly. If your allocating huge numbers of objects or keeping large numbers of records in datasets, unnecessarily, then you need to rewrite parts of your app to reduce it's memory consumption. But only you will know if that's even possible.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks dave i think i found the problem.
thanks a lot
abhinav
|
|
|
|
|
Hi Guys
I hope some body can help me, to tell me how to format decimal value wittout round up ?
Many thank for you
ICE
|
|
|
|
|
If you want to simply format have a look at the documentation of the formatstrings (i.e. tostring method documentation or format function).
|
|
|
|
|
Mr.Briga
Thank you for youra reply, actually I have ever tried to use Format string but I still got the decimal in rounding up state. The format string which was I used is "###.00"
I have a example:
I have three Textbox ( textbox1,textbox2,and textbox3) result from textbox1 divide to textbox2 will store in textbox3,
on textbox1 I enter 12000 and on textbox2 I enter 10039, actually the result must be 1.19 store in textbox3, but when I run this program on textbox3 I see 1.20 not 1.19 as I need.
Could you please to tell me how should Itype the right format on Textbox3 in order to get the right decimal format like I need.
Thank you
ICE
|
|
|
|
|
It seems from this article: VB Format string Rounding[^] that what you are seeing is by design.
I found this by googling "vb format string rounding".
...Steve
|
|
|
|
|
Than it's more about rounding/truncating rather than formatting.
If you want to truncate to a certain digit you can use several approaches, two are here:
1)
Function TruncateToDecX(v as double,d as double) as double
v=v/d
v=int(v)
v=v*d
return (v)
end function
You use it passing v=1.1999 and d=0.01 (where you want to truncate) you get 1.19
2) Quick and dirty
dim s as string=v.tostring
s.substring(0,s.indexof(".")+2)
|
|
|
|
|
Hi all,
Someone say that, C# is stronger than VB.Net.
What do you think?
Can you help me to list the strength of C# that VB.Net hasn't.
Nice day.
Thanks.
inew
|
|
|
|
|
This topic has been discussed at length on The Code Porject many times. Have a scan of the older articles and board topics and I'm sure you'll find something.
in summry - there are some differences between the languages and what they can provide function-wise, however it's really a matter of taste which language you use especially since they (mostly) compile to the same CLR for the .NET platform.
There are strong arguments for and against borh. I use both - most of my code these days is in VB because that seemed to be the 'lowest common denominator' (i.e. everyone understood it) but my background is largely in C/C++ so I sometimes feel more at home with C#.
...Steve
|
|
|
|
|
Hi,
During the Code mode, my mouse Scroll is not functioning. is there anywahy how and make it works?
icdavid
|
|
|
|
|
icDavid wrote: During the Code mode, my mouse Scroll is not functioning. is there anywahy how and make it works?
Do you mean that you cannot scroll the text editor (source code) window using the scroll wheel on your mouse? If so, I don't believe that that window supports scrolling by that method.
...Steve
|
|
|
|