|
This probably should be in the C# forum, since the question really goes down into what is silence in audio data and what type of audio encoding is within the WAV file. What it comes down to is you're going to have to interpret the PCM data in the WAV file.
|
|
|
|
|
|
|
How to add the video String(OSD), I use DirectX.Capture Class Library?
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
private Capture capture = null;
private Filters filters = new Filters();
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
capture = new Capture(filters.VideoInputDevices[0], filters.AudioInputDevices[2]);
try
{
if (capture.PreviewWindow == null)
{
capture.PreviewWindow = panelVideo;
}
else
{
capture.PreviewWindow = null;
}
}
catch (Exception ex)
{
MessageBox.Show("Unable to enable/disable preview. Please submit a bug report.\n\n" + ex.Message + "\n\n" + ex.ToString());
}
}
private void button2_Click(object sender, EventArgs e)
{
capture.FrameEvent2 += new Capture.HeFrame(CaptureDone);
capture.GrapImg();
}
private void CaptureDone(System.Drawing.Bitmap e)
{
this.pictureBox.Image = e;
capture.FrameEvent2 -= new Capture.HeFrame(CaptureDone);
}
private void button3_Click(object sender, EventArgs e)
{
if (!capture.Cued)
capture.Filename = @"F:\demo.wmv";
capture.RecFileMode = DirectX.Capture.Capture.RecFileModeType.Wmv;
capture.Cue();
capture.Start();
}
private void button4_Click(object sender, EventArgs e)
{
capture.Stop();
}
}
}
modified 22-Dec-11 5:44am.
|
|
|
|
|
Hi All,
I have a website (web application) publish to an IIS server and it is work fine, but the problem is if i open or request the site from the internet more than 10 times the site go down and dosen't work from the internet or from the local network, its work just from the IIS (go to the IIS and Browse the site from it).
And i restart the IIS but this step doesn't solve the problem. The only thing that solve it is to restart the whole Machine (Computer Server).
please help me if you know any solution.
Best Regards.
Zeyad Abed Aljalil
Senior Developer
Isra' Software & Computer Co.
|
|
|
|
|
You already posted this on Quick Que/Ans.
Continue on that and, stick on one. don't spam the board with reposts.
check my comment on Quick Que/Ans Post.
IIS Web Site Problems[^]
Rajesh B --> A Simple Programmer <--
modified 22-Dec-11 5:00am.
|
|
|
|
|
Include the link(of the question) in your message.
|
|
|
|
|
Updated..
Rajesh B --> A Simple Programmer <--
|
|
|
|
|
How is this a C# question?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
I'm having great difficulty serializing an object that uses a field that is of type Type .
The field can be any of the fundamental types, and when I try to serialize the object using the XmlSerializer,
it bombs with the following exception:
"The type 'System.Int64' may not be used in this context"
Is it possible to serialize the type Type ?
SOLUTION:
Instead of trying to send Type over the wires, I now just send the text name of the type, then use
Type.GetType(name); to reconstruct it at the other end.
The difficult we do right away...
...the impossible takes slightly longer.
modified 22-Dec-11 0:47am.
|
|
|
|
|
You should be using Object rather than Type. Type is used in Reflection to determine characteristics of an object; it isn't a generic placeholder.
No comment
|
|
|
|
|
You're right, I changed the design so that it uses the Type 'FullName' property instead of the type itself.
Then at the other end, I just say
Type.GetType(typeName);
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
As another responder indicated, Type.GetType(typeName) will not always work. I can name a few situations right off the top of my head:
1) if your code is in a DLL and the type is in the calling EXE or another assembly, you must use the fully qualified name for this method to work.
2) if your code is on machine A in A.DLL and called by A.EXE on machine A and it gets serialized over the wire to machine B where its decoded by A.DLL again, it won't work unless A.EXE is running in the process AND has the same exact FQN as machine A did. i.e. if machine A has version 1.0 of A.EXE and machine B has version 1.1, it won't work.
|
|
|
|
|
Thanks for the feedback. I agree totally with what you say.
However, the Type will only ever be one of the fundamental types: int, long, string, etc..
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Richard Andrew x64 wrote: The field can be any of the fundamental types
Can someone put in some other type? If so...
Richard Andrew x64 wrote: Type.GetType(name);
might not work.
A safer solution might be to define an enumeration that contains only those types you wish to support and pass an instance of that.
|
|
|
|
|
I agree with what you say, however, there is no chance that it could be a complex type. It will only be one of the fundamental types: int, long, string, etc..
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hello,
I'm in a large organization, and sometimes have things running on a server that I have to leave running and my profile will go idle.
How can I catch a system event for remote log off? That way I can auto answer it and cancel the remote log off. The screen I would see when someone is trying to log me off is
http://img841.imageshack.us/img841/9306/disconnected1.jpg[^]
and if I don't respond in 30 seconds, I can be kicked. The organization is far too large to stop this at a global level, so how can I protect my processes and have them continue to run without being booted?
I wrote a form that will catch the the following
SystemEvents.SessionEnding += new SessionEndingEventHandler(sessionHandler);
but that does not seem to be the event that is occurring when a remote log off occurs?
This is for server 2008.
Thanks for reading!
modified 21-Dec-11 15:08pm.
|
|
|
|
|
I think if you log into the admin console they can't log you off.
|
|
|
|
|
Hi,
Thanks for the reply, this is in server 2008 (I forgot to put that earlier) and there is only /admin. I tried /admin and that was able to be logged off.
|
|
|
|
|
If the other guy has admin rights to the box, I don't think you can stop it. Remember, you are using the same protocol (RDP) that he is. You could disable RDP access for everybody except a special user you create, but I think a domain admin could still override you. Or anybody with access to the box.
I won't argue with you about just making it a service (since you already said you don't want to for whatever reason), but you can RUN it as a service:
http://www.tacktech.com/display.cfm?ttid=197[^]
|
|
|
|
|
Thanks!
I can create a service in visual studios also, but unfortunately that isn't optimal in this situation.
I have domain admin rights, I'd just like to be able to catch the log off event, cancel it and query AD, send them a pop up and say "Hello [ ], please don't kick me off, as I'm running [ ]"
But it appears that I'm the only one that has tried this
|
|
|
|
|
One other idea I had that may or may not work is if you trap the WM_QUERYENDSESSION window message. I know it works to block a local logoff / shutdown, but not sure if it will work remotely. Give it a whirl, might be what you are looking for.
|
|
|
|
|
I will try that, thank you!
|
|
|
|
|
Not sure if server 2008 supports this as it was added in Vista, but there is also the ShutdownBlockReasonCreate API that goes along with that windows message.
|
|
|
|
|
If you have long running processes, then perhaps they shouldn't be running under your personal login credentials. You should perhaps install them as services using a service account for credentials.
I wasn't, now I am, then I won't be anymore.
|
|
|
|