|
Hi Guys,
How to Programatically find the name application pool of an application.
Thanks
Yaju
|
|
|
|
|
Does this[^] article help?
/ravi
|
|
|
|
|
hi Ravi
The article you mentioned gives me list of all application pools configured but what i am looking for is a way to programatically find out the application pool in which my application is residing.
Thanks
Yaju
|
|
|
|
|
If you scroll towards the bottom you'll see the example titled "I use this code snippet to get the application pool in which my website is running." Hope that helps.
/ravi
|
|
|
|
|
i need to get machine localization in my website.
i change my machine localization ("Regional and Language Options" control panel.)
and check with below code but always it shows as 'en_US'..
string strCluture = CultureInfo.CurrentCulture.Name;
what i need to do to get current localization. am i missing some setting or what?
|
|
|
|
|
Mugdha_Aditya wrote: i change my machine localization ("Regional and Language Options" control panel.)
and check with below code but always it shows as 'en_US'..
string strCluture = CultureInfo.CurrentCulture.Name;
what i need to do to get current localization. am i missing some setting or what?
Did you restart your application after you changed the setting? The CultureInfo is set for the app when it starts, and (luckily) doesn't change while running - even if the user changes it. The new CultureInfo should be displayed after you start your app.
Mugdha_Aditya wrote: i need to get machine localization in my website.
Care to explain a bit? You're fetching the culture of the webserver, not of the connected clients.
Bastard Programmer from Hell
|
|
|
|
|
Hey...
Thanks for the your reply.
I have restarted my application as well as my pc.
still its not applying selected culture.
|
|
|
|
|
Apart from CurrentCulture , there is also CurrentUICulture .
Since you're talking about a web site, do not forget to set the CurrentUICulture to the desired value whenever a new thread (!) is started - otherwise your web site will always run in the localization of your web server.
E.g.
System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo("de-DE");
Threads get their culture specific settings from the operating system, not from the thread they were started from.
|
|
|
|
|
i dontt want to set culture , i want to getculture info.
i have done below changes in page load but still its not working.
System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo("de-DE");
string strCluture = CultureInfo.CurrentCulture.Name;
strCluture returns en-US
|
|
|
|
|
how can i prevent my system in case of any theft also i want to block os installation?
|
|
|
|
|
You cannot protect any system completely.
|
|
|
|
|
Is that really a C# question?
Try a BIOS password. But since the thieves have physical access, they can always get around whatever you throw at them.
The first hit you get when you google BIOS password is a site with methods to reset it. Even if all of them fail, they could just replace the motherboard.
|
|
|
|
|
You can't. Well, not entirely true, but it would take a LOT more money and effort than it's worth. It'd be cheaper to buy a new laptop.
|
|
|
|
|
You could look into this Lojack for Laptops[^]. After one of my laptops was lifted I have used this with good effect. I haven't had any others stolen but I test occasionally, you can locate the laptop online. I have reinstalled the OS and still it works.
No comment
|
|
|
|
|
Lojack for Laptops can protect you to some extent, but it can do nothing if the hard drive is pulled out. If you are more concerned about the safety of the data, you'd better use encryption on the hard drive. Use something like TrueCrypt. It's free. Use encryption on all your removable media, too. These tend to vanish when you need them. Lojack will not be able to protect them.
|
|
|
|
|
loyal ginger wrote: but it can do nothing if the hard drive is pulled out.
Not entirely true. According to their website Lojack will still function if the drive is replaced and some laptops come with it preinstalled in the bios. I've used Lojack, but can't remember if I've replaced a drive while it was installed.
No comment
|
|
|
|
|
Mark Nischalke wrote: According to their website Lojack will still function if the drive is replaced
and some laptops come with it preinstalled in the bios.
Pretty sure that the first is completely dependent on the second.
|
|
|
|
|
With Windows 8 and a new mainboards with UEFI 2.3.1 firmware, "Secure Boot" (or "Secure Startup") will be available, which is intended for such cases.
For the UEFI spec see http://www.uefi.org/specs/[^].
|
|
|
|
|
I need to capture whats happening on the screen for a streaming application. I have this method for "making a screenshot":
private void CaptureScreen()
{
Bitmap bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
Graphics gfxScreenshot = gfxScreenshot = Graphics.FromImage(bmpScreenshot);
gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
string fileName = ConstructFileName();
bmpScreenshot.Save(fileName, ImageFormat.Png);
}
But using GDI+, seems not "serious" and "professional" enough for the purposes of my application. I think that it may potentially add some unneeded overhead to the screen capture.
Can you suggest alternatives which are "better" and "more optimized" for screen capturing, please?
I'm taking a shot in the dark and actually thinking of something with DirectX?
Regards!
|
|
|
|
|
The problem of such application is not the screen capture part. Look at the bandwidth an application streaming the whole screen every time would need! The more important thing is to detect the differences between two subsequent screen shots, send only these differences to the other computer, which will then "integrate" them into the current picture.
|
|
|
|
|
Thank you for the response and the additional information, sir.
However back to my question - do you think thats a good way to capture the screen or is there a better one?
|
|
|
|
|
What makes you think what you've done here is not 'professional'?
The resource usage here is going to be in allocating a new bitmap and writing it to file. What you probably want to do is have two Bitmaps which are allocated once, one for last frame and one for this frame (or one for even and one for odd, if you want to avoid switching the references each frame), so you can diff them.
|
|
|
|
|
Yes, sir. This is only a test project and it is planned to be done as you said.
What looks to me not "professional" enough is the easy way that i'm actually capturing the screen.
<pre lang="cs">private Bitmap CaptureScreen()
{
_gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
return _bmpScreenshot;
}
This is what actually bothers me. It looks way too easy to use the
Graphics.CopyFromScreen(....)
method for optimized purposes. Usually the easiest ways are not the most optimized ones and i'm just searching if there is anything better than this.
|
|
|
|
|
Don't prematurely optimise. If you find that this is a performance bottleneck (which I really, really doubt) then you can look for clever tricks.
Often the simplest way is the best. How would you optimise '2+2'?
|
|
|
|
|
BobJanova wrote: Don't prematurely optimise.
Hear hear!
BobJanova wrote: Often the simplest way is the best
Often (at least with computers), what at first appears to be simplest is not.
|
|
|
|