|
jnwel wrote: How do I make it so when a button is clicked, the application will open.
Process.Start(@"path to application");
Yes, you need to know the full path, or just give a filename if the exes are in the same folder as your exe.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello everyone,
Any idea about how to get the content-type for a video file? I am writing an ASP.Net application which writes video binary content back to browser client to invoke related media player, and needs to fill-in the content-type field of response header.
thanks in advance,
George
|
|
|
|
|
You've been here long enough to know where the ASP.NET forum is. There's also tons of websites that list all the known content types. If you're asking how to know what the type is, the file extension is your best bet.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
So sorry, Christian!
Forget that forum, moving there.
regards,
George
|
|
|
|
|
George_George wrote: which writes video binary content back to browser client to invoke related media player
This is determined by the browser and not your ASP.NET application. ASP.NET can't invoke related media player on a client machine.
As CG said, this is wrong forum.
|
|
|
|
|
Thanks Navaneeth,
I will move to ASP.Net forum, let us move there.
regards,
George
|
|
|
|
|
hello all,
i have a c# window application form in which i have made options through the menustrip like file---> Open-----> New----> EXIT .... etc
here i have written the code this.close() for EXIT. and if i run the application and click the EXIT it will close the application
Now i want the same thing to be occured if i press ctrl+x through the Keybord.
How to code this in c#.
Thanks & Regards
TJS
|
|
|
|
|
As far as I know you can set the shortcut from the properties window in visual studio.
|
|
|
|
|
hello Giorgi Dalakishvili,
Thanks a lot
TJS
|
|
|
|
|
You are welcome
|
|
|
|
|
you can also use keydown envent
|
|
|
|
|
Why complicate things that Framework can handle itself?
|
|
|
|
|
Any recommendation for this?
|
|
|
|
|
If a method has no side effects, and fetches something in a fairly straightforward manner (it shouldn't read a database or something), yes, consider using a property instead.
Cheers,
Vıkram.
Stand up to be seen. Speak up to be heard. Shut up to be appreciated.
|
|
|
|
|
Hi Guys,
I want to write to event log with log4net eventlogappender, but could not get the output in event log. Below is my code snippets
<code>Creating root</code>
Hierarchy root=(Hierarchy) log4net.LogManager.CreateRepository("trial");
root.Configured=true;
root.Root.Level=log4net.Core.Level.Warn;
log4net.ILog log=log4net.LogManager.GetLogger("trial",root.Name);
log4net.Repository.Hierarchy.Logger loggerRepo=(log4net.Repository.Hierarchy.Logger)log.Logger;
<code>create layout</code>
log4net.Layout.PatternLayout objPatterLayout=new log4net.Layout.PatternLayout("Date:%d,Thread:[%t]");
<code>add appender to root after setting its properties</code>
EventLogAppender appenderEventLog=new EventLogAppender();
appenderEventLog.MachineName=".";
appenderEventLog.LogName="System";
appenderEventLog.ApplicationName="trial apps";
appenderEventLog.Layout=objPatterLayout;
appenderEventLog.ActivateOptions();
loggerRepo.AddAppender(appenderEventLog);
log4net.ILog log2=log4net.LogManager.GetLogger("trial",typeof(Form1).Name);
if(log2.IsErrorEnabled)
log2.Error("Error from trial apps");
if(log2.IsInfoEnabled)
log2.Warn("info from trial apps");
I use to get IsErrorEnabled as true, but cant see the output. I think I am missing Source, but there is no property to set the source.
Pls let me know, if I miss any properties.
thanx in advance.
Thanks,
Chintan(India)
|
|
|
|
|
Do you have enough permissions to write to event log?
|
|
|
|
|
Hi Giorgi,
Yes, I have full admin permission.
I try the same with .NET EventLog class which was working fine...
Thanks,
Chintan(India)
|
|
|
|
|
Hi,
I have created an entry in a custom event log:
if (!EventLog.SourceExists("TestSource"))
EventLog.CreateEventSource("TestSource", "System");
EventLog evtLog = new EventLog();
evtLog.Source = "TestSource";
evtLog.WriteEntry("This is a test", EventLogEntryType.Information);
I now decide to use my own custom log so I change "System" to "TestLog".
This doesn't do anything. The event is still logged to the "System" log even if I try deleting the source but if I use a different source, it then gets logged correctly to "TestLog"
if (EventLog.SourceExists("TestSource"))
EventLog.DeleteEventSource("TestSource");
If I go into the registry, I find a list of sources for the System event log but even if I delete the TestSource entry from there it still logs events to the System event log.
This MSDN article suggests that you can remove a source association from a log but it's not correct as far as I can tell:
http://msdn.microsoft.com/en-us/library/k57466fc(VS.71).aspx[^]
What's going on? It seems that once a source is associated with a log there's no way of removing that association.
|
|
|
|
|
Restart your machine...Hope it will work.
Thanks,
Chintan(India)
|
|
|
|
|
hello
Anyone done class property/attribute validation in C# (not ASP.NET but simimlar concept) using reflection? I'd avoid writing my own custom validator - anything out-of-the-box to do this?
Thanks
dev
|
|
|
|
|
Are you the only one who knows what's valid?
|
|
|
|
|
i am just hoping the kind of validator available to ASPNET is available for C# (or is it?)
dev
|
|
|
|
|
I don't know enough ASP.net to render an informed opinion.
|
|
|
|
|
devvvy wrote: Anyone done class property/attribute validation
What do you mean? Do you want to validate your business rules? If yes, here[^] is an excellent article on CP.
|
|
|
|
|
hey this is actually what I am looking for.
I was hoping there's something straight from dot-net framework though.
Thanks
dev
|
|
|
|