|
I try this:
[WebMethod]
public void GO()
{
System.Diagnostics.Process H = new Process();
H.StartInfo.FileName = @"d:\siw.exe";
H.Start();
H.WaitForExit();
}
but still not working
whay ?
|
|
|
|
|
Okay, so what is not working exactly? Do you get an error message?
Btw, calling an exe from an asp.net application can be difficult because of security issues. Check whether the aspnet-process has the rights to see and execute your exe-file.
|
|
|
|
|
Hi there,
Ocassionally, due to malware infection, it is seen that some of the infected or suspicious files or folders can be neither deleted nor renamed and when tried to do so, a messagebox is display something like this: "The file/directory cannot be deleted because it is in use by another program or whatsoever". In such case, we have two options, either format the drive containing the file or continue with it.
However, let me directly come to the point. I have written a program which will create a directory with the following code:
{
System.IO.Directory.CreateDirectory("c:/myfolder");
}
With the above code, I have created a folder "myfolder" in the c: drive. But, this folder can be easily deleted. I want to know that how can I create a process or program associated with it running continuously, such that whenever the user tries to delete the folder, the messageBox "The file/directory cannot be deleted because it is in use by another program" is displayed and the user fails to delete it?
Help me and I assure that your help will be appreciated,
Thanx..... and sorry for my poor english (I am trying to improve),
Rajdeep.NET
|
|
|
|
|
Why you want to do that? What happens if user deleted the directory?
|
|
|
|
|
Well, you could create a file within this directory. Open the file with a stream and let this stream open. This will block the file (and directory) as long as your app is running. If you put the code for this in a windows service the app will run as long as the pc...
Regards
Sebastian
P.S.: By the way, what kind of app are you trying to build?
|
|
|
|
|
Actually,
I am trying to understand the way in which a worm or a freaky virus works. I am creating a removable tool. Thanx for your help
Love u a lot,
Take care,
Rajdeep.NET
|
|
|
|
|
Be sure to tell us when you release this removal tool, so we know when to not download it
|
|
|
|
|
It's the same thing every program does with an open file. You can't delete a file while it's in use, windows won't let you (Or most any other OS for that matter). In order to delete the file you have to stop the process that's using it. In order to delete a file that a virus is using, you have to unload the virus from memory.
The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.
|
|
|
|
|
I am not at all sure about your reasons for doing this, but if I wanted to I would start out by researching FileStstemWatcher .
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi Experts.
Pls Help Me How To Make Thread Safe Application in C#.NEt ............
Pls Help Me................
Thank u
Dinesh Sharma
|
|
|
|
|
Sharma Dinesh Kumar wrote: To Make Thread Safe Application in C#.NEt ............
Read the tutorials and comeback with specific questions. This[^] will be a good start.
|
|
|
|
|
Pen p = new Pen(Color.Black,PenWidth);
GraphicsPath gp=new GraphicsPath();
gp.AddLine(StartPoint,EndPoint);
gp.Widen(p);//error:outofmemoryException
|
|
|
|
|
This will happen when StartPoint == EndPoint.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
thank your answer ,but incorrectness.
Pen p = new Pen(Color.Black,PenWidth);
GraphicsPath gp=new GraphicsPath();
Point StartPoint=new Point(234,123);
point EndPoint=new Point(567,345);
gp.AddLine(StartPoint,EndPoint);
gp.Widen(p);//error:outofmemoryException
This will also happen when StartPoint != EndPoint .
|
|
|
|
|
That code works for me with no exception. The only way I can generate an exception is if the points are equal.
Is this the actual code you are using? If not, the problem could be elsewhere in your code and not manifesting itself until the Widen call.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
thanks for your answer ,you are right.
|
|
|
|
|
Hi Experts
Please Help Me About The Static Keyword in C#.NET
But is Diff. Between Int i;Static Int i;
and Why And When We Make Static Class ,Methods or Variable Declare Static in C#.NET
....................
Pls Pls.................
Dinesh Sharma
|
|
|
|
|
Static says that something is not bound to objects.
Class members are usualy members of the instances, not of the class itself.
Static changes this and the attributes of methods are part of the class itself, you can't access from instantiated objects, because they don't have it.
The advantage instance members are as many times in the memory as you have instantiated objects, while static members are only once in the memory, no matter how many instances you have (even 0).
Also, as static members are independant from instances, you can use them to provide things to work with for all objects instantiated from a class.
If it is was an instance member, the value would differ for each instance, in case of methods they usually don't have acess to other instances.
Static members are called by using the point (.) operator directly from the class name.
For example int.Tryparse () is a static method that does not get called from an instance (an int variable or radical), but the class itself.
|
|
|
|
|
Adding to the first reply, Static variables got more lifetime. It stays in the memory until the application domain where it is hosted ends.
Sharma Dinesh Kumar wrote: And When We Make Static Class ,Methods or Variable Declare Static in C#.NET
There are many situations where static classes or methods are appropriate. One example is, Singleton[^] design pattern implementation.
|
|
|
|
|
|
The CellValueChanged event triggers, I believe, after the cell you've been editing comes out of editmode.
I would say, on the buttonclick of your updatebutton use your CurrentCell's EditedFormattedValue in your db updating method.
Hope this makes sense...
var question = (_2b || !(_2b));
|
|
|
|
|
|
half-life wrote: and the thing is that Pressing the Enter button or not does;nt change the fact that the value has changed
It has changed on the screen, but has it changed in the bindinglist?
But why should anyone answer your question? You obviously know all the answers already!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
|
Oh really, it's no problem!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|