|
|
.NET Framework 2.0 has the DriveInfo class that you can use to get a list of drives and info about each of them.
--
Hello, I'm a signature virus. Copy me into your signature to help me spread.
|
|
|
|
|
hi, i need create appz for using/control modem v32 bis.
where i can read some manual about this.
thx.
Athlon 64 3500+, Gigabyte GA-K8NXP-9, 2x512 DDR400 Kingston, Inno3d 6200 PCIe, SS2 B2C2 v2.6, HDD := 450gb, Genius 56k int, NEC DVD-RW и мать его Суньмастер 550.
|
|
|
|
|
i want to make a setup project that creats a database to target machine
is there anybody who knows ??
|
|
|
|
|
isnt there anybody who knows how to do this? it is very important and urgent for me
|
|
|
|
|
Hi
Please let me to ask my problem from you.
I want to record user's sound. may be there are several codes to do this.
But I want that my program create blank wave file and then open Windows Sound Recorder that record sound on that blank file.
Openning Sound recorder is easy :
<br />
Using System.Diagnostics;<br />
Process.Start("sndrec32.exe");<br />
How can i create blank file and enforce Sound Recorder to use that file.
Please Help me
Thank You.
-- modified at 5:29 Saturday 28th January, 2006
|
|
|
|
|
Your only bet is finding command line parameters for sndrec32.exe to do that..
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hello Again.
NoBody helped me, But I found my answer myself and I want to share it with everbody.
<br />
using System.Diagnostics;<br />
using System.IO;<br />
Now use this :
<br />
Process.Start("sndrec32","C:\\File1001.wav") ;<br />
Or this :
(I Created new blank Wave File and enforced Sound Recorder to Play it
<br />
string strFilePath="C:\\" + "File1002" + ".wav" ;<br />
File.Create(strFilePath) ;<br />
ProcessStartInfo startInfo = new ProcessStartInfo("sndrec32.exe");<br />
startInfo.Arguments = strFilePath ;<br />
Process.Start(startInfo);<br />
Use it and enjoy!
-- modified at 5:18 Sunday 29th January, 2006
|
|
|
|
|
Hi,
Its giving me a Error like "Can't Open File c:\file001.wav"
I tried both methods of doing that... but both methods are showing me same error..
One more quest abt is how to Record the Sound.. ie process.Start(...) is responsible for opening soundRecord exe after that how to press "Record" button programmatically...
Send me ur suggesstions
|
|
|
|
|
You got problem beacause the file is not exist or its already open !
Use this :
<br />
string strFilePath = @"C:\" + "file1001" + ".wav" ; <br />
FileStream waveFile = File.Create(strFilePath) ;<br />
waveFile.Close() ;<br />
Process.Start("sndrec32",strFilePath) ;<br />
It worked on my system.
|
|
|
|
|
Hey everybody
I'm trying to write a program that will check if my disc-on-key is connected or not. I tried to use the "printer usb connected checker" article as an example, but it doesn't work. can anyone at least give me a small hint on how do I check if a disc-on-key has been connected?
I also thought of checking any changes in the number of drives, but I'm looking for a more elegant way.
Thanks Alot!!!!
|
|
|
|
|
Hi All !!! There are some Projects using NumericUpdown from NumericUpdown Screen without using arrows, moreover there is not any hidden layer too. cause should u set a number with 3 digit the 3.rd digit continous working. The thing I wonder is that is that a new control or a code. Can someone give me some clueas about it.I am really Puzzled. A .Net Vb Or C# code would be enough.
|
|
|
|
|
Hi all,
I "add" a wav file to my project "file.wav" and made it embedded resource.
now i have seen here and micosoft code to read and play it but
its not working..what am i doing wrong?
my code:
private byte[] m_soundBytes;<br />
<br />
private enum Flags<br />
{ <br />
SND_ASYNC = 0x0001, <br />
SND_MEMORY = 0x0004, <br />
}<br />
[DllImport("winmm.dll",CallingConvention = CallingConvention.Winapi)]<br />
static extern int PlaySound(byte[] wfname,int hMod,int sf);<br />
then there is the class WSounds:
<br />
public WSounds(string s)<br />
{<br />
string sss = Assembly.GetExecutingAssembly().GetName().ToString();<br />
Stream a = Assembly.GetExecutingAssembly().GetManifestResourceStream(sss + "." + s);<br />
m_soundBytes = new byte[a.Length];<br />
a.Read(m_soundBytes, 0, (int)a.Length);<br />
}<br />
<br />
<br />
public void Play()<br />
{<br />
PlaySound(m_soundBytes, 0, (int)(Flags.SND_ASYNC | Flags.SND_MEMORY));<br />
}<br />
this line throws exception : m_soundBytes = new byte[a.Length];
so i guess something with the resource is wrong..
i tried another code too:
<br />
System.IO.Stream strTheme = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("file.wav");<br />
byte[] bytTheme = new byte[strTheme.Length];<br />
strTheme.Read(bytTheme, 0, (int) strTheme.Length);<br />
<br />
by the way: how do i need to add a WAV file ? under resources sub-dir or on the main project?
Thanks in advance,
Ran
R.Z
|
|
|
|
|
I had troubles with exactly this stuff last week.
ranzask wrote: this line throws exception : m_soundBytes = new byte[a.Length];
so i guess something with the resource is wrong..
The Stream a is probably null, because the assembly couldn't fine the resource. "file.wav" won't work either, because you have to prefix the file.wav with the project namespace (at least in VB.Net).
You can do
string[] names = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames();
foreach (string name in names){
Debug.WriteLine(name)
} and look for the name you want (this is the way i did it ).
ranzask wrote: by the way: how do i need to add a WAV file ? under resources sub-dir or on the main project?
That doesn't matter. Whatever the folder may be, it doesn't matter for the compiler, just like C# source files.
HTH!
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick || Fold With Us! || Pensieve || VG.Net ||
|
|
|
|
|
Thanks alot !!
i did it and change my resource name to include the namespace too and it worked
Thanks again.
Ran.
R.Z
|
|
|
|
|
[Marc] wrote: because you have to prefix the file.wav with the project namespace (at least in VB.Net).
You have to do it in C#, too. <smile />
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
ranzask wrote: I "add" a wav file to my project "file.wav" and made it embedded resource.
now i have seen here and micosoft code to read and play it but
its not working..what am i doing wrong?
You could check out my article here[^]
Share and enjoy.
Sean
|
|
|
|
|
i allready saw that , its too complicated for me
but i figured out my mistake.
R.Z
|
|
|
|
|
Hi,
Its very complicated to see the code,, so please post ur sample piece of code, and also post what is the problem u are facing and whts the solun you found.. its useful for all the beginners as well as developers..
Bye
|
|
|
|
|
the final code is:
<br />
using System;<br />
using System.Runtime.InteropServices;<br />
using System.Diagnostics;<br />
using System.Threading;<br />
using System.IO;<br />
using System.Reflection;<br />
namespace yournamespace<br />
{<br />
public class WSounds<br />
{<br />
private byte[] m_soundBytes;<br />
private bool disable=false;<br />
private enum Flags<br />
{ <br />
SND_ASYNC = 0x0001, <br />
SND_MEMORY = 0x0004 <br />
}<br />
[DllImport("winmm.dll",CallingConvention = CallingConvention.Winapi)]<br />
static extern int PlaySound(byte[] wfname,int hMod,int sf);<br />
<br />
public WSounds(string s)<br />
{<br />
if (s == null)<br />
{<br />
disable = true;<br />
return;<br />
}<br />
<br />
try<br />
{ <br />
Stream a = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(s);<br />
m_soundBytes = new byte[a.Length];<br />
a.Read(m_soundBytes, 0, (int)a.Length);<br />
}<br />
catch (Exception e) { disable = true; }<br />
}<br />
public void Play()<br />
{<br />
if (!disable)<br />
PlaySound(m_soundBytes, 0, (int)(Flags.SND_ASYNC | Flags.SND_MEMORY));<br />
}<br />
}<br />
<br />
<br />
}<br />
then in your main code you must add a file to your resources list "file.wav" for example that will be along the classes..and change his property to :"embedded resources" so it will compile him along with the exe.
and you call the class this way:
<br />
private WSounds ws;<br />
<br />
ws = new WSounds("yournamespace.file.wav");<br />
<br />
ws.Play();<br />
thats it.
R.Z
-- modified at 6:05 Monday 30th January, 2006
|
|
|
|
|
Hello is there a way to Use the DirectX Api to encode MPEG2 files from a capture card using c#
Any help would be great --
Thanks in Advance
|
|
|
|
|
I new to c# but I am having a lot of fun with it. But there are a couple of thing that I am trying to do, but have not found the solution to.
I want to make a window that should be “glued” to the top and the middle of the screen. It should have an “always on top” function. And when I do not point my mouse over it, it should “slide away” after a certain delay (the only ting I shall be able to see is a progress bar). When I move my mouse over it again, the window should “slide out” again (like a drawer)
Does anyone knew of a component that could do this or is there any other way ?.
|
|
|
|
|
Hi,
I tried to create a web services and the button OK is not active.
I have write to write on that directory. So what it mist there?
Thanks
Gregoire
|
|
|
|
|
What do you mean by the OK button is not active ? Web Service creates a service, there is no user interface or OK button associated with it. Please be more specific.
Simon
|
|
|
|
|
Hi,
I wasn't able to find any posts about this so hopefully this is the first.
I'm trying to use Single.Parse() in .net 2.0 to parse "99.5E-1". However, after it parses the float value is 9.949999998... etc. Why does it do this, and not have it as 9.95?
Thanks,
Stephen
|
|
|
|