|
Hi
Suppose my computer is connected to internet (directly through dialup or via a lan). How can I stop applications (running on it) to access internet? And to allow only specified application to access the internet? Target Environment is Windows 98/XP.
I wanna develop an application in C#... using which user can check the application and can allow them to access the net.
Regards;
fadee
|
|
|
|
|
You would need to simply create an application that listens to specific ports (i.e. - port 80 for internet 443 I think for SSL) and then just control access (kill the application) when you see access to those ports. For C# you you will need to include using System.Net.Sockets; .
HTH
Nick Parker
|
|
|
|
|
fadee wrote:
I wanna develop an application in C#... using which user can check the application and can allow them to access the net.
I don't know the details but you could probably run a filter on port 80 to stop WWW traffic. Maybe check out Net Nanny and similar products to see how they do it. You could then extend that to other ports.
Or you could just install a firewall system on the PCs you want to control. Most firewalls have options to allow/disallow traffic on certain ports and even stop/let-through certain application traffic.
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
|
|
|
|
|
If I understand your question:
.NET has a bunch of security settings that can prevent/allow an app to access the internet.
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
I want to be able to detect when the Clipboard contents change.
For example someone selects a text.
There are some WinAPI functions but I couldn't do anything.
Can someone help me?
|
|
|
|
|
I did some looking through Win32, and I didn't see any functions that tell you when there's something new on the clipboard.
If you know of some functions, you could call them from C# using DLLImport.
|
|
|
|
|
Look at:
SetClipboardViewer
ChangeClipboardChain
The WMDRAWCLIPBOARD message should be handled.
Does someone have any idea how to be done. Please help with sources because I've done it in Delphi but can not make it run on .net
Here is some Delphi's code:
To set:
NextHandle := SetClipboardViewer(Handle);
To unset:
ChangeClipboardChain(Handle, NextHandle);
To handle:
procedure TScrnShot.WMDRAWCLIPBOARD(var Msg: TMessage);
begin
if Clipboard.HasFormat(CF_BITMAP) then
Memo1.Lines.Add('Screen Shot!');
if LongWord(Msg.WParam) = NextHandle then
NextHandle := Msg.LParam
else
SendMessage(NextHandle, WM_CHANGECBCHAIN, Msg.WParam, Msg.LParam);
end;
|
|
|
|
|
I'd like to write an application in C# that reads and displays the contents of the Windows Address Book wab file. Can this file be read, maybe through Jet?
|
|
|
|
|
|
public delegate void EventHandler(int Index);
public event EventHandler PressIcon;
public virtual void OnPressIcon(int index)
{
if (PressIcon != null)
PressIcon(index);
}
..
OnPressIcon(this.SelectedIndex);
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
public delegate void EventHandler(int Index);
public EventHandler PressIcon;
This does however work. Although it looks not right, can some please explain what the difference is between the above and this below?
public delegate void EventHandler(int Index);
public event EventHandler PressIcon;
protected virtual void OnPressIcon(int index)
{
if (PressIcon != null) PressIcon(index);
}
I know options 2 is the "correct" way, but how does this differ?
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
i think
1. The second give the user the ability to override what happens in that event in derived classes
2. if an event handler is not attached to PressIcon, then it will be called, but there will be no body, that is why the first gives an exception when the code is called, with no event handler attached.
get what i mean>?
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
Nnamdi Onyeyiri wrote:
if an event handler is not attached to PressIcon, then it will be called, but there will be no body, that is why the first gives an exception when the code is called, with no event handler attached.
get what i mean>?
You didnt note the changes ?? In example 1 i declare only a delegate, not an event delegate, thus the OnPressIcon function is not neccesary and u call the delegate directly.
In the implementation , u would just call "it" like u would for an event except u call the delegate directly. This works! But what are the differences between the two?
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Hi all,
I try to have a MDI application.
What I am trying to do is to make main window to have a treeview control in it. I want to place on left side of the main window. So, when a child window is opened and maximized it will occupy the rest of space on the main window.
How can you accomplish this?
ATM, i already tried, but when i maximized child window, it occupy the whole main window space.
Thanks for the help
Eka
|
|
|
|
|
Set the TreeView 's Dock property to DockStyle.Left , that should be all you need to do.
Assuming you set the child form's MdiParent property to the instance of the main form.
James
|
|
|
|
|
Hi all,
I try to open and read from a text file but it always gives me error.
Code as followed: (the "UserList.lst" is the same dir with the exe which is
C:\Read\bin\Debug)
FileStream fs = new FileStream("UserList.lst", FileMode.Open);
StreamReader sr = new StreamReader(fs);
I get error on the first line which it says:
"Un unhandled exception of type 'System.IO.FileNotFoundException'
Additional information: Could not find file "C:\Read\bin\Debug\UserList.lst"
Can someone help me with this?
(The file UserList.lst is in that dir)
Thank you
NT
|
|
|
|
|
|
Thanks Leppie actually my code or your code as shown work.
In windows XP, Explorer doesn't work the correct file extension.
Have a nice day Leppie.
|
|
|
|
|
Works fine here; perhaps the filename was mistyped?
James
|
|
|
|
|
I have made a windows form in C# and I want it to permanently be displayed on the computer desktop.All other applications should have open under it.What I mean is that any application which opens should have the desktop area below my form available to it.
My form is a small strip.
|
|
|
|
|
|
With top most property the form will become the top- level window.I want this top level window to be dockable to the desktop.Something like the APPBAR.
|
|
|
|
|
|
Hi,
I wrote a multi-threaded application that sends/recieves documents on a scheduled/event driven basis. It works fine as a console application the files are being sent and the CPU usage is around 30%. My problem is when I have the exact same code in a Windows Service application. When the service is using one thread to send documents it also works fine, but if there is more than one thread running at one time the CPU usage shoots up to 100%. Could someone please help me?
Thanks
P.S. The applcation is also using the System.Timer and File System Watcher.
Thanks Again,
Aisha
|
|
|
|
|
I am writing a client/server application with the server running on Linux written in C++ and the client application running on Windows XP written in C#. I am sending JPEG images over the network from cient to server and am getting some very odd behavior. It appears that after each JPEG I transmit I get about 1 - 3 packets containing 1 byte of useless information. Is this something with BinaryWriter that is it sending additional informaiton about what it sent?
Thanks,
Steven
|
|
|
|