|
You can have your processes save their state at regular intervals, and run a second "shadow" process that monitors the primary processes.
When the shadow process detects that one of the primary processes was stopped (e.g. with Task Manager), it restarts that process, using that process' saved state to pick up where it left off.
|
|
|
|
|
krishnavaradharajan wrote: no one should kill my processes through Task Manager.
And what are you going to do, if the user tripped the power cable? Why do you want to prevent the user from killing your buggy application.
|
|
|
|
|
hi,
the easy way would be to disable the taskmanager for the user using policies.. it sounds like the user will have no ability to to certain changes on the system either, so would be using policies the right way if not it would be a way too =)
|
|
|
|
|
Remember that it is your software, but it is not your computer! All the tricks you can apply to prevent the owner of the computer from closing an application running on it could be considered as not politically correct!
|
|
|
|
|
Can you tell us why you'd like to implement this behavior? There may be a more acceptable means of meeting your requirements (which may be perfectly valid), but it's hard to guess without a use case. If you stated the big picture, you may get some helpful replies.
/ravi
PS:
I've often fallen into this trap myself. When I ask someone how to do something, I invariably end up at a better solution by answering why I'd like to do this (i.e. what's the end result I'm trying to achieve).
|
|
|
|
|
|
I would use a ListBox , and choose DrawMode.OwnerDrawVariable ; then use the MeasureItem and DrawItem events, and the Graphics.MeasureString() and DrawString() methods.
|
|
|
|
|
Hi all other system giving
DateTime.Now.ToLongDateString() as Wednesday, July 28, 2010
But my system giving 28 July 2010
wht is the probs, y its giving like tht?,
To get asusal like others system dateformat where i should change in my PC?
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
You could - but you don;'t need to. The default DateTime.ToString method returns whatever your PC is set to, but you can tell it to return exactly what you want. See Here[^] for full details.
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
Hi Griff, Thanks for ur reply,
I already created lot of project in the same way...,
So i cant go and modify all the project place the date format like (MM/dd/YYY)...,
If i change on single place(PC), it will work for all projects...,
Thats y asking, where to change the date format in PC, to get asusal format like others machine...,
i have changed in my date format and restarted, thn also getting same dd MMM yyyy
Plz any one guide me
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
Member 3879881 wrote: If i change for PC it will work for all projects...,
...that are run on that PC.
Run your app on someone else's PC and you have no idea what results you will get... Bad idea to rely on PC user setup for specific features!
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
i have checked the same project with other pc i got my result exactly...,
my i/p & o/p goiing fine in other pc...,
But in this pc wht i need i didnt get
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
So it proves that your code does not work in all cases. The solution is to update your code so that it does, not change the cases where it doesn't.
|
|
|
|
|
This is not the correct way to go. Changing a system setting like that will only screw up the data/time format for EVERYTHING on that PC, not just your app.
It's your job to update your code so that is works and plays nice with others. The solution you want is just you being lazy. The correct solultion is to properly write the code so that the users don't need to worry about what your app is doing to other apps on their machines.
|
|
|
|
|
there is a Control Panel often called Regional Settings where each PC user chooses the way dates, times, currencies, etc. are shown by default. For user interaction your app can (and should) choose to use those default settings (that is when you use those specialized methods such as ToLongDateString(), they really mean "take whatever format the user has chosen"). The advantage is the user gets what he prefers, the disadvantage is you cannot predict how wide things will be and the screenshots in your manual may slightly differ from the user's reality.
Of course, there also are situations where the format must be fixed, e.g. when writing the date to a file that is going to be used on some other system. That is where you should use ToString() and either pass an explicit formatting string or have your thread's CultureInfo fixed.
|
|
|
|
|
Hi,
How to increase the font size of the text and size of the controls, when we click on maximize button of the form. Please guide me to achieve this. Thanks in advance.
|
|
|
|
|
To achieve this first post this question on the appropriate forum, please. This one is for C#, and what you're asking is for Windows Forms development. There's a Windows Forms forum here.
Don't forget to rate answer, that helped you. It will allow other people find their answers faster.
|
|
|
|
|
If you change the font size of your form, your controls (on the form) will follow this change and will resize automatically. So the only thing you need is to change the font size of your form.
Here is an example for you:
public partial class Form1 : Form
{
float defaultFontSize;
float bigFontSize;
public Form1()
{
InitializeComponent();
defaultFontSize = this.Font.Size;
bigFontSize = 16;
}
private void Form1_Resize(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Maximized)
{
if (this.Font.Size < bigFontSize)
{
FontFamily ff = this.Font.FontFamily;
this.Font.Dispose();
this.Font = new System.Drawing.Font(ff, bigFontSize);
Invalidate();
}
}
else if (this.WindowState == FormWindowState.Normal)
{
if (this.Font.Size > defaultFontSize)
{
FontFamily ff = this.Font.FontFamily;
this.Font.Dispose();
this.Font = new System.Drawing.Font(ff, defaultFontSize);
Invalidate();
}
}
}
}
Put some controls on your form and see what happens.
|
|
|
|
|
Thank you for your prompt reply
|
|
|
|
|
You're welcome!
|
|
|
|
|
I would like to generate the data retrieved from a dictionary in a text file, and I would like your help please, if anyone can help me with ideas or examples. thank you
|
|
|
|
|
Please elaborate on your problem. Am I correct in assuming that you have a Dictionary<type, type> and you want to save it to a text file?
If so:
1) Open the file
2) Iterate through your dictionary
3) Write each entry to the file
4) Close the file
Which part are you having difficulties with?
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
I have a dictionary that contains the problems and solutions and I want to write the data into a text file as a table, I'm stuck in the writing of these data in text file
|
|
|
|
|
A simple way to accomplish this is to iterate over the KeyValuePair items and write them out to a Stream. You'll need to delimit the items somehow. I'm not saying this is the best way, but it may achieve exactly what you want.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
ok, thank you, I'll try and I'll gave the results
|
|
|
|