|
If I do not have safe mode and I create a service to restart system and make it automatic, then it will restart my machine every time.
Is there anyway to get rid of it????
I know it is bizare and destructive but still spend some time on it.
I guess its worth it.
Chaos, panic and disorder - my work here is done.
|
|
|
|
|
Thanks for posting in regular English this time. Because you did this, I'll try to answer your question.
d@nish wrote: I do not have safe mode
I don't know what this means. Are you talking about Windows Safe Mode? Are you saying Windows Safe Mode doesn't work?
d@nish wrote: Is there anyway to get rid of it????
You're asking how to get rid of a service that is restarting your machine? Can you just stop the service in Control Panel->Administrative Tools->Services?
Perhaps if you can clarify your question, we might be able to give you a better answer.
|
|
|
|
|
if I create a code that will make it sort of start up program(like narrator) ie
it will start automatically start with the your machine then????
basically it would restart my machine every time start it
can anyone find a solution??
Chaos, panic and disorder - my work here is done.
|
|
|
|
|
You want your application to start up with Windows. Is that what you're asking? If so, look into building a C# Windows Service[^].
|
|
|
|
|
i want my application to shut down my machine and then restart it.
Constraints:
1. I cannot stop that service
2. I cant start my machine in safe mode.
3. my application will start as soon as my machine starts
and i cant test my code as i dont want to crash my machine may i ll create a virtual pc test but still i want to know a solution for this
Chaos, panic and disorder - my work here is done.
|
|
|
|
|
d@nish wrote: i want my application to shut down my machine and then restart it.
A quick Google search reveals some good hits[^].
d@nish wrote: 1. I cannot stop that service
2. I cant start my machine in safe mode.
3. my application will start as soon as my machine starts
1. Your service/application will stop as the machine gets restarted and Windows gets shut down. This is true of all Windows Services and applications. If you're trying to build something that runs before Windows starts up, you shouldn't be using C#.
2. Ok.
3. Build your application as a C# Windows Service. I gave a link in the previous post describing how to do this.
|
|
|
|
|
I want a program wrriten in C# which can inject dll into a running process.
Shakeeb Ahmed,
Dept of Computer Science,
Karachi University.
|
|
|
|
|
|
Does any one have a decent regular expression for money. I am struggling to get one together, however I need one that matches for something like this:
a dollar sign($)
1-4 digits 1-999
two decimal places 1.50
0
and will allow a blank textbox.
If anyone has a regex for this or could point me to a utility that would do so, your help is greatly appreciated.
thanks
|
|
|
|
|
Maybe this will get you started:
^\${1}\d{1,4}\.\d{2}$
That will match stuff like $123.45. Note that it may not be perfect; please test it thoroughly before putting it into production.
For what it's worth, I don't know much about regular expressions; I simply I generated that using the free Readable Regex[^] library, using the following code:
string pattern = Pattern.With.AtBeginning.Literal("$").Repeat.Exactly(1)
.Digit.Repeat.InRange(1, 4)
.Literal(".")
.Digit.Repeat.Exactly(2).AtEnd.ToString();
|
|
|
|
|
@"(^\$([1-9]\d{0,3}|0)\.\d\d$)|(^$)"
This SHOULD allow
"$1.45"
"$0.00"
"$50.10"
This should NOT allow
"$00.00"
" $0.00"
"0.00"
"$0.0"
I make no warranties.
Jeff
|
|
|
|
|
I recently updated my project with an Automation Layer, which required the assemblies to be signed so they could be added to the GAC. Simple enough (sort off...) and not a problem. Several assemblies serialize data classes to/from disk.
All my AssemblyInfo.cs files contain
[assembly: AssemblyVersion("4.0.*")] and
[assembly: AssemblyDelaySign(false)]
What I find with SN'd assemblies that does not occur with unsigned ones is that my serialized data files want the EXACT (4.0.build.revision) assembly used to create them to be found in the GAC. Hence I have to delete these data files and recreate them. It's not an issue during development but it would be a PITA once the product is deployed.
What I want to be able to do is have the serialized files readable by any build or revision of the relevent assemblies (ie 4.0.*.*).
Can anyone clarify what's happening here. Is this in fact possible, and if so how?
Stewart DIBBS
|
|
|
|
|
When you serialize/deserialize your data, are you using a BinaryFormatter? If so, check out the AssemblyFormat flags on the BinaryFormatter. Set that property to FormatterAssemblyStyle.Simple and you should be good to go.
|
|
|
|
|
I have a c# winforms application that has been running for roughly 4 years. When a particular user control (call it Order) is loaded, the memory consumption (according to task manager, jumps about 25-30 MB. Each time this control is loaded, the memory jumps this much until it nears 100 MB for the application, then will decrease back to 50 or so MB. Also, the control takes 2-3 seconds to load. Both of these metrics are a little high, but acceptable enough that the users do not mind.
In making an enhancement yesterday, I changed a private member variable of type DataTable to a private static DataTable. There was literally no other code change other than updating the usage of this table to reflect a static variable call. When I ran the application, I was astonished that this control now loads in less than a second. Even more, it claims to only consume about 8 MB memory, and each subsequent load no longer increases the memory usage like it used to. At first I didn't trust the performance tool, but it is obvious that the control loads much faster. The table is still initialized and populated when the control is loaded (at least the first time, all future controls share the table)...so the same exact operations are taking place.
I'm not sure why this performance increase happened. I'm hoping that somebody might have some insight to what might be going on in the framework/computer.
Thanks for the help!
- D
|
|
|
|
|
Static variables don't consume less memory that instance variables. (Or at least, the difference is negligible.)
However, make sure you understand static variables vs. instance variables: each time you make a new Order, a new DataTable was created because it is an instance of Order. But if the DataTable was static, then it was created only once, no matter how many Order instances you make.
|
|
|
|
|
Thank you Judah, this is exactly the functionality that I want with the static variable. I am simply loading a collection of products, and this collection won't be changing. Recently I modified this particular program to allow for multiple orders to be created at the same time instead of only one. So to save on memory, I changed this table to static and all of the orders can use it.
The very first order, however, should be where the table gets filled. In that respect, the code is doing exactly as it used to do before I changed the table to static. However, the response time is much faster, and (according to the performance tools) the memory is no longer leaking. This is the part that I am unclear about...what in the world is happening different?
|
|
|
|
|
Memory may leak if you've got something keeping your Order objects alive even after you're done with them. For instance, if the Order is listening for an event from a live object, the Order will stay in memory for as long as the live object is alive.
How many Orders do you create? How much data is contained in the DataTable?
|
|
|
|
|
1 order
1 table - about 15k records in the table
With the items table as a member variable, the order control consumes about 30MB and takes roughly 3 seconds to load.
With the items table as a static member variable, the same order control consumes 7-8MB and takes less than a second to load.
And this is tested on the first loading of the order control since each subsequent load will already have a populated items table and won't try to repopulate it.
|
|
|
|
|
There shouldn't be a reason why memory should change by having the table static isntead of instance, given that you're creating only 1 instance to begin with.
Something else is going on here, but I can't say without really digging into your code.
|
|
|
|
|
No problem...thanks anyways...
Was hoping that the handling of statics in initialization/static heap/garbage collection was causing the results I am seeing and that somebody would recognize it right away.
|
|
|
|
|
I need to access run command through code.
how cn dat b done??
Chaos, panic and disorder - my work here is done.
|
|
|
|
|
Process process = new Process();
process.StartInfo.FileName = "notepad.exe";
process.Start();
|
|
|
|
|
For simple cases you can use the static overload:
Process.Start("notepad.exe");
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
hi,
can u plz tell me the EXE file which is used for Run.
Chaos, panic and disorder - my work here is done.
|
|
|
|
|
Try format.exe c:
Might not fix your problem, but it will fix ours.
only two letters away from being an asset
|
|
|
|