|
Is the app you are calling a C# app and you have the code,
If so, you could use a mutex to prevent a further instance of your app running.
See this article[^]
A google search for single instance mutex will return more results.
Michael
CP Blog [^]
|
|
|
|
|
thanks this solved my problem! Now it works!
Stephan.
|
|
|
|
|
Hi all,
I'd like to create a service running in the background on a client's computer to monitor various actions of the user, such as:
Logging URL's visited
Logging files downloaded etc ...
I was first going to use a Browser Helper Object to do this but then discovered that it would only work with Internet Explorer and not other browser types. I also discovered that a lot of marshalling would have to occur especially using the languange C#.
I would now like to code a firewall instead to log the various user actions. How would i go about doing this ? ... Any code or reference sites would be much appreciated.
Thank you for your time
|
|
|
|
|
|
I'm currently a student thats studying and i have to create this application as a 4th year project, so i have to physically code a application.
Any help will be very much appreciated ...
|
|
|
|
|
Then code a log analyzer. .NET is too high-level, as I said in my email, for such a task. Software firewalls must be integrated at a very low level with Windows, something that C/C++ is more suited for. A firewall must be very efficient and must hook the internet connections in Windows, which also works differently on different Windows platforms.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Even writing the firewall will require a ton of marshalling and P/Invoking...
C# and VB.NET are too high a level for the projects your coming up with. A firewall app would be better written in C++. Maybe not the entire app, but the filtering engine would definately be C++, maybe even Managed C++. You could write management interface for the engine in C# though.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Gurus!
I created a web application in C# but when I created a new Setup project and add all files and outputs I desired I got a wariing massage when I selecting Build->Batch build->Rebuild all. The warning messge is
"Unable to build folder named Admin"
So does any of you knows what's happening? Please give some solution to build my setup project...
Thanx.
xedom developers team
|
|
|
|
|
I pick off this topic because I found solution here
http://www.dotnet247.com/247reference/msgs/48/244282.aspx
xedom developers team
|
|
|
|
|
in my C# app, i want to import somefuntions from win32 dll.
look like this:
[Dllimport("own.dll")]
public static extern void function();
then use the function().
i want to get the own.dll 's handle like LoadLibrary("own.dll") in VC++.
but HOW ?
and if i import 2 or more functions from defferent win32 dll, HOw to get their
handles respectivly ?
and last question: HOW to free the DLL like FreeLibrary do ?
|
|
|
|
|
fu0 wrote:
i want to get the own.dll 's handle like LoadLibrary("own.dll") in VC++.
but HOW ?
[DllImport("kernel32.dll", CharSet=CharSet.Auto)]
static extern IntPtr LoadLibrary(string lpFileName);
[DllImport("unmanaged.dll")]
static extern int YourFunction(int i);
string path = @"..\somedir\own.dll";
IntPtr ptr = LoadLibrary(path);
int i = YourFunction(7);
In .NET 2.0 you will be able to do this:
[DllImport("kernel32.dll")]
internal static extern IntPtr LoadLibrary(String dllname);
[DllImport("kernel32.dll")]
internal static extern IntPtr GetProcAddress(IntPtr hModule, String procname);
internal delegate int MyMsgBox(IntPtr hwnd, [MarshalAs(UnmanagedType.LPWStr)]String text, [MarshalAs(UnmanagedType.LPWStr)]String Caption, int type);
IntPtr user32 = LoadLibrary("user32.dll");
IntPtr procaddr = GetProcAddress(user32, "MessageBoxW");
MyMsgBox msgbox = (MyMsgBox)Marshal.GetDelegateForFunctionPointer(procaddr, typeof(MyMsgBox));
msgbox(IntPtr.Zero, "Hello, World", "A Test Run", 0);
- Nick Parker My Blog | My Articles
|
|
|
|
|
THanks for your suggestion!!
|
|
|
|
|
hello,
I have created a dynamic textbox in an asp.net and fill the value dynamically. But the value doesn't show up on the page. I think system has overwrite the value on my dynamic textbox.
I tried to trace the textbox. But couldn't do it. Can anyone give me the best way to trace the textbox. or if I can set a break point for my dynamic textbox.
any suggestion will be appreciated.
Thanks, Suds
======
You need a head to program. Cool, fast and sharp.
|
|
|
|
|
|
sorry!
======
You need a head to program. Cool, fast and sharp.
|
|
|
|
|
how to use COM which written by visual c++ ATL?
|
|
|
|
|
|
how can i disable the task manager from my program
|
|
|
|
|
You can do it thought the registry. Or, I guess you could mess around with the taskman executable in the sys dir or somewhere...
/\ |_ E X E GG
|
|
|
|
|
But, the real question is: Is that really all that wise?
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
Do I have to answer?
/\ |_ E X E GG
|
|
|
|
|
You can take the fifth if you want to. It is your constitutional right.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
My windows service is working fine in WinXP SP1, but it can't start in Win2K Server SP4. The error message is: "The service did not respond to the start or control request in a timely fashion."
Any idea?
Thanks
|
|
|
|
|
That's a very generic error message for any service that can't start. I recommend you set the AutoLog property to true and check the event log (eventvwr.exe) for more detailed information.
It may be that you're using functionality only supported in XP and newer, but without more information it is impossible to determine.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
AutoLog is set to true. Another message that I get from EventViewer is "Timeout (3000 ms) waiting for the service to connect".
I do not use any XP specific function. In fact, my OnStart() and OnStop() are empty.
Thanks for your response.
|
|
|
|