|
redfish34 wrote: in favor of periodically running a second firewall to watch the primary one
You don't want to do that. You'll cause yourself more headaches than it's worth. I've had too many people call me up and tell me "I can't get to the Internet anymore". My first question is always "What's did you do?" The usually answer is "Nothing!", but then I find out they installed a second firewall, or a third, without uninstalling the first one.
Yes, app's can phone home. It's not really that big of a deal. Most of them are not sending any nasty information about you, but are checking for updates. It seems the popular thing to do now that Windows does it.
If you want to see what they're doing, install a packet sniffer. Microsoft has Network Monitor...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
OK. First what you'd want to look into is the code on the application detecting when user logs on to the internet. Unfortunitly I don't have that much knowlage so far.
Your onto something great if you could get it going.
I had an idea for this sort of thing once but cannot do it. The application I wanted to create would:
If a virus was being downloaded it would follow the virus and give the the IP address of the computer that it came from. That be a good extra if it could be done.
In the end we're all just the same
|
|
|
|
|
In C# ListView Control.
We use shift or ctrl key to add or remove multiple items from listview.
Is there any programable way to add or remove selected items or indices from ListView? Like I can manually add/remove items from SelectedItems collection or add/remove index from SelectedIndices.
Thanks
Tengpo
|
|
|
|
|
You can iterate thru the Selected ListViewItem Collection and add/ remove items
Here is the code to remove the selected items.
foreach(ListViewItem li in lstViewResultSet.SelectedItems)
{
li.Remove();
}
hope this will help you.
Gokul
|
|
|
|
|
I know this is a really stupid question, but why am I getting the above error at the line
in my codebehind when I set the Label1.Text variable? I set runat to server in my code
page and I've declared the control in my codebehind. I would think that the variable
would be accessible anywhere in the codebehind page.
Thanks.
// Codepage:
<asp:label runat="server" id="Label1">// Codebehind:
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Repeater Repeater1;
private void Page_Load(object sender, System.EventArgs e)
{
string connString = "Data Source=(local);Initial Catalog=MyTable;User ID=MyUID; Password=MyPwd;";
string sqlString = "SELECT Column1, Column2 FROM SomeTable";
try
{
using (SqlConnection conn = new SqlConnection(connString))
{
conn.Open();
using (SqlCommand cmd = new SqlCommand(sqlString, conn))
{
SqlDataReader rdr = cmd.ExecuteReader();
if (rdr.Read())
{
Repeater1.DataSource = rdr;
Repeater1.DataBind();
}
}
}
}
catch
{
Label1.Text = "Error!"; // <- Object reference error occurs here
}
}
}
|
|
|
|
|
the same code is working fine for me ..
but it would be good if u mention the line where it catches the error
sathy
|
|
|
|
|
imsathy wrote: it would be good if u mention the line where it catches the error
I did. Didn't you see the line with the comment?
// <- Object reference error occurs here
|
|
|
|
|
RobertF57 wrote: did. Didn't you see the line with the comment?
// <- Object reference error occurs here
the code execution comes in to catch block after the error occurs ...
what im asking u is at which point it catches the error
keep a break point in ur code and c where the try block catches error
sathy
|
|
|
|
|
You probably missed something in the label. What does the code for the label look like?
---
b { font-weight: normal; }
|
|
|
|
|
Does anyone have an example of how to persist the values from an enum into a
Checked Listbox in the Visual Studio property Grid? There is an excellent example on this site by Thierry Bouquain (http://www.codeproject.com/cs/miscctrl/flagseditor.asp) but it uses code in the client page to persist the values Checked Listbox/ Enum values. I want mine to work more like third party components I have seen wqith no code in the client form required to persist the values. I have looked around and I think I need to use a TypeConverter to convert the selections to a pipe delimited string and stored in the designer. Getting the typeconverter to work has been complicated as I do not have a lot of experience with CodeDom / Reflection.
|
|
|
|
|
I am having a weird problem adding new objects to the directory server. I am logged in using the Manager account, so I have r/w access to everything. Here's how I add an object:
DirectoryEntry de = configuration.Bind(); // <- this works fine, I can read everything.
DirectoryEntry newEntry = de.Children.Add("cn=John Doe", "inetOrgPerson");
newEntry.Properties["sn"].Value = "Doe";
newEntry.Properties["givenName"].Value = "John";
newEntry.CommitChanges(); // <- this is where the exception is thrown.
System.Runtime.InteropServices.COMException (0x80072037): There is a naming violation.
at System.DirectoryServices.Interop.IAds.SetInfo()
at System.DirectoryServices.DirectoryEntry.CommitChanges()
at HMSImport.MainForm.menuItem3_Click(Object sender, EventArgs e) in c:\documents and settings\jd\my documents\visual studio projects\hmsimport\mainform.cs:line 255
Does anyone have a clue as what it could be?
I am running openldap-2.2.9 as the directory server.
|
|
|
|
|
Hi Jan,
I dont think you should do like this:
newEntry.Properties["sn"].Value = "Doe";
newEntry.Properties["givenName"].Value = "John";
rather use Add instead of Value this it should work
newEntry.Properties["sn"].Add = "Doe";
newEntry.Properties["givenName"].Add = "John";
I hope it helps
Osama Mirza
|
|
|
|
|
I am trying to achieve the following:
I start with two class library projects, e.g. phlib/phtree/phtree.sln and phlib/phmatrix/phmatrix.sln. Both have sub projects with examples, Q&D tests and unit tests.
I want to create a "main" class library project (phlib/phlib.sln), that references the relevant sources from the sub folders (but excludes the helper projects code)
is that even possible? C# (at least C# express) seems to always include all files. When I do "Add existing item", the file gets copied into the phlib project folder.
Some of us walk the memory lane, others plummet into a rabbit hole
Tree<t> in C# || Fold With Us! || sighist
|
|
|
|
|
Private Sub Socket_DataArrival(ByVal eventSender As System.Object, ByVal eventArgs As AxMSWinsockLib.DMSWinsockControlEvents_DataArrivalEvent) Handles Socket.DataArrival
I have this already put into my Constructor
<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
socket.dataarrival += new EventHandler(Socket_DataArrival);
Do i need to use the AxMSWinsockLib ?? because i'm not sure what goes in the Code Below here
private void socket.dataarrival(object sender, // Dont know what is suppose to be in this part)
Thxs in Advance..
-- modified at 17:55 Thursday 2nd February, 2006
|
|
|
|
|
I want to create a virtual serial port from my program, so I can send out serial data. I want my program to simulate an actual physical device, such as a GPS or Gyro, for testing purposes. I have seen many comercial programs that create two virual ports, and connect them, but I want just my program to expose itself as a serial port.
Ross King
------------------------
"Beer. Not just for breakfast anymore"
|
|
|
|
|
|
|
I'm currently having a problem, i hope one (or more) of you can help me out.
I have an application that loads DLL's from a directory in a seperate AppDomain. After that it gets the functions i want out of it using the System.Delegate class. So far so good. The functions are proparly loaded etc etc.
The thing is, i can only call the functions from within that particular AppDomain. At least thats what i think the problem is. But i do not want that. I want to be able to define the functions that i need from outside the wrapper that loads the dll's. I can say which functions it needs to pass to me but i cant attach a delegate to it in order to invoke the function.
Since i think the story above might be a bit confusing i'll set up an example.
Example:
<br />
delegate int Foo ();<br />
delegate void Bar (int Foobar);<br />
<br />
dllWrapper Wrapper;<br />
<br />
Wrapper.INeed("Foo_Inside_DLL", typeof(Foo));<br />
Wrapper.INeed("Bar_Inside_DLL", typeof(Bar));<br />
<br />
FunctionList myFunctions = Wrapper.LoadAll("plugins\\");<br />
<br />
<br />
Function FooFuntion = myFunctions.Find("Foo_Inside_DLL");<br />
<br />
((Foo)FooFunction.Delegate)();<br />
<br />
<br />
|
|
|
|
|
|
ahhh, never knew it would be that simple!
thanks, you're a life saver!
Edit (for those who want to know):
when you have functions in a seperate AppDomain you can _not_ call them from any other domain directly. What you can do is create a method in the class that contains the function that does a DynamicInvoke()
so in my case it was as simple as this:
<br />
FooFunction.Invoke(null);<br />
<br />
public object Invoke (params object[] args)<br />
{<br />
this.Delegate.DynamicInvoke(args);<br />
}<br />
and thats it, it works brilliantly!
-- modified at 18:14 Thursday 2nd February, 2006
|
|
|
|
|
Is there a simple way to do this? I've been working on an app with a gui (mostly because it's easier to test) because I know someone who said it was easy to turn an app into a service once you had it tested the way you want. He did it in VB.Net, though and I'm no longer in touch with him. As a service, it really doesn''t need the GUI, but I'd rather do it this way and not let the form show than copy/pasting all the code and getting rid of all the form-specific stuff.
My articles
BlackDice
|
|
|
|
|
Your form contains user interaction elements -- such as buttons / menus / textboxes etc. For service, you need single starting point for the thread.
- Malhar
|
|
|
|
|
that sounds like Chinese Algebra to me. wtf???
My articles
BlackDice
|
|
|
|
|
BlackDice wrote: that sounds like Chinese Algebra to me
I think I might know what he means.
I think he is trying to say that a service has a single starting point and has no user interaction. In otherwords, it starts and keeps on going until it is shutdown with no user interaction - unlike a GUI which starts and waits for user interaction before doing anything.
In other words, if your GUI has more than a single "Go" button, and your code interacts with the GUI in any way after that then it will need some work to get it to work as a service.
If your GUI is just using the textboxes and so on to set values for various methods to test one small area of processing, but the whole still works like a service, then there shouldn't be too many problems.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"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
|
|
|
|
|
Ok. I've also looked at your post about the nUnit method. that sounds ok. But keeping to what you said in this post I'm replying to, that's all that's on the form is an exit button. It actually starts running once the form starts running. the only thing on the form is a listbox that shows trace statements; this would be written to a log file instead.
It let me add a form to the project, so I copied/pasted all my code into that form. I have the service compiling now, but I still need to add the setup stuff to it. I don't want the form to actually show though. Should I just hide it, or is there also a better way?
My articles
BlackDice
|
|
|
|