|
I want to make a 3rd party program that listen packets sent between a server/client application running on my PC. I think that it’s done by placing a hook that capture the packets sent, but I don’t know how to do it. Can anyone help me please?
|
|
|
|
|
There are lots of articles in codeproject for that:
http://www.codeproject.com/cs/internet/sharppcap.asp
http://www.codeproject.com/csharp/pacanal.asp
http://www.codeproject.com/dotnet/dotnetwinpcap.asp
http://www.codeproject.com/csharp/pktcap.asp
|
|
|
|
|
|
lol... I voted 5 for your reply!
|
|
|
|
|
Hello everybody.
I create a relation between two table by using below code.
ds.Relations.Add("REL", ds.Tables["Parent"].Columns["A"], ds.Tables["Child"].Columns["B"]);
After that I delete a record from table Parent which is parent table. Deleting proccess running truly however child rows have not been deleted from other table.
What must I do.
Thanks.
|
|
|
|
|
I believe you need to set up the relation with a cascade delete to remove the child rows.
This can be done by setting delete rule of the relation to Cascade.
e.g.
DataRelation rel = new DataRelation(ect);
rel.ChildKeyConstraint.DeleteRule = Rule.Cascade;
ds.Relations.Add(rel);
(I have not tried this so am not 100% sure it will work)
|
|
|
|
|
I used below codes but it didn't work.
ds.EnforceConstraints = true;
ds.Relations["REL"].ChildKeyConstraint.DeleteRule = System.Data.Rule.Cascade;
ds.Relations["REL"].ParentKeyConstraint.DeleteRule = System.Data.Rule.Cascade;
|
|
|
|
|
Sorry.
There is a Constraints property on the DataTable. Try creating a ForeignKeyConstraint object and setting the DeleteRule = Rule.Cascade, then add it to the child table.
|
|
|
|
|
Hi all,
I have a tabcontrole with a usercontrole placed on one of the tabs.
on this usercontrole is a button, when the user clicks the button i need to change the selected tab on the tabcontrole.
anybody got any ideas ???
any help would be most appreciated !!!
Thanks
John
|
|
|
|
|
this.tabControl1.SelectedIndex = 1;
Just fill .SelectedIndex with the TabIndex what you want.
|
|
|
|
|
thanks for the answer but this doesnt work
The problem is that this. refares to the usercontrole and not the form with the tabcontrole on it.
any more help would be great !!!!
Thanks
John
|
|
|
|
|
What is "this" ?
Is "this" a TabControl ?
If yes, then use this.SelectedIndex = 1; (for example)
|
|
|
|
|
What is "this" ?
The this keyword refers to the current instance of the class.
My problem is how to reference the form from within a usercontrole placed on the form.
for example tabcontrol.SelectedIndex = 1; would not be able to escape the usercontrole subsequently it would not work because the tabcontrole is placed on the form not the usercontrole
Hope this makes my prob clearer !
Thanks once again for your time
|
|
|
|
|
john34 wrote: My problem is how to reference the form from within a usercontrole placed on the form.
Use the FindForm method.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
this wont let me at the tabcontrol.selectedindex or any of the public methods on the form
Thanks again though
|
|
|
|
|
Hi all
Thanks Lots for all your help
the bellow code allows me to get to the public methods of the parent form.
I am well chuffed !!!!!!!
Form myForm = FindForm();<br />
if (myForm.Name == "Frmtest")<br />
{<br />
Frmtest test = (Frmtest) myForm;<br />
test.test();<br />
}
Thanks so so much
John
|
|
|
|
|
I created a Custom Control that have a Label control. When i add this control in my aspx page, by default all the property value comes from the asp.net. But i wish to take only few property such as Borderstyle at design time,Font (with style) at design time, Background at design and run time and
FontColor at design and run time only. Please help me ............. to solve this problem.
I am using asp.net 2.0 with c#.
Thanks in Advance
Shail Nigam
-- modified at 9:16 Monday 7th August, 2006
Thanks in Advance
Shail Nigam
|
|
|
|
|
Wrong forum. Go to ASP.NET forum.
|
|
|
|
|
I think it is only possible to do the reverse of what you want. i.e. You can make properties available at design and run time, or at run time only.
If i have mis-understood, u can use the browsable tag above the properties that you dont want to be able to see at design time.
e.g.
[Browsable(false)]
public string data
{
get { ect }
set { ect }
}
|
|
|
|
|
thanks for help, but my main problem is that all the default properties are come itself . How can i stop it?
|
|
|
|
|
Hi,
I have spent all day on this and can't find the problem. Here's some code for a combobox that just won't show the name associated with the value passed to it:
[code]
this.comboBoxDefaultTitle.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.newMemDefaultsBindingSource, "TitleNumber", true));
this.comboBoxDefaultTitle.DataSource = this.titlesBindingSource;
this.comboBoxDefaultTitle.DisplayMember = "TitleDesc";
this.comboBoxDefaultTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.comboBoxDefaultTitle.FormattingEnabled = true;
this.comboBoxDefaultTitle.Location = new System.Drawing.Point(50, 57);
this.comboBoxDefaultTitle.Name = "comboBoxDefaultTitle";
this.comboBoxDefaultTitle.Size = new System.Drawing.Size(151, 21);
this.comboBoxDefaultTitle.TabIndex = 1;
this.comboBoxDefaultTitle.ValueMember = "TitleNumber";
[/code]
I have done this before in the same project (different form and lookups) and they work fine. The above, plus two others on the same form and with similar tasks don't.
I've cross checked the relationships and compared them with the combobox that works and I just can't find what I've done wrong.
I've checked the msdn at http://msdn2.microsoft.com/en-us/library/3h6ac01k(d=ide).aspx and swear I've followed each step to the letter.
Can anyone please give me some suggestions as to where else I need to check to get this working.
Thanks,
Glen Harvy
|
|
|
|
|
Glen Harvy wrote: Can anyone please give me some suggestions as to where else I need to check to get this working.
After considerable searching on the internet I came accross someone with a similar (but not identical) problem that was resolved by someone pointing out that if a specified row in a datatable doesn't exist then the values shown to the user are those for the first row in the datatable.
What that means is that the datatable that is being looked up must be filled prior to the datatable that is being instantiated.
The wording above may not be right but the solution was to fill the newMemberDefaultsBindingSource AFTER the other binding sources had been filled.
Makes sense actually
Glen Harvy
|
|
|
|
|
Im appling a texture to a mesh, i was wondering how would i go about making it place slightly off to the right of where it currently is?
im using managed directx if that helps
|
|
|
|
|
Hello Friends,
Can we check version of installed messanger on the machine.
If possible how to do that. I am currently using COM library of
Messanger. And i have found "MessengerAPI.MMESSENGERPROPERTY"
But i am not understanding how to use that one.
Thanks In Advance.
Rahul Kulkarni
|
|
|
|
|
You can use also FileVersionInfo, see this example, just replace notepad with you messenger:
FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(@"C:\WINNT\NOTEPAD.EXE");
string s = "File: " + myFileVersionInfo.FileDescription + '\n' +
"Version number: " + myFileVersionInfo.FileVersion;
Console.WriteLine(s);
|
|
|
|