|
use a checkedlistbox instead
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Is it a possibility to use a checkedlistbox?
Good luck!
|
|
|
|
|
|
|
I'd suggest to keep it as simple as possible;
ProcesCommand("EVENT", "Other params"); You'd have to write that method yourself, off course. It's easier to swap the contents of a variable then to swap the method that you're using.
You could also search CodeProject for some articles on creating scripts. You could then launch a (precompiled?) script, depending on the parameters that you receive
|
|
|
|
|
Eddy Vluggen wrote: You could also search CodeProject for some articles on creating scripts. You could then launch a (precompiled?)
See what I can find. Thanks for the suggestion Eddy ... every bit helps.
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
Is there any easy way to monitor the amount of bytes sent and received on http port 80? I don't want to monitor the content of packets, just number and size of packets is important to me.
Is TcpListener class suitable for this purpose?
Any help would be greatly appreciated
|
|
|
|
|
You can user PerformanceCounter component by setting CategoryName property to Network Interface and after selecting appropriate counter.
|
|
|
|
|
Hi
using api hooking you can monitor the network usage such:
wsock32.dll has two funcaiton in the socket level
1 send
2 receive
from that you can monitor and it works fine.and it calculates the entire upload download.
|
|
|
|
|
Hi
I`m trying to run timer on tick method after clicking the button and i dont really understand how it can be done.
can anyone help please ??
for example :
private void button1_Click(object sender, EventArgs e)<br />
{<br />
myTimer.Enabled = true; <br />
<br />
}<br />
<br />
private void myTimer_Tick(object sender, EventArgs e)<br />
{<br />
}<br />
|
|
|
|
|
I suppose you are trying to do something like this:
private void button1_Click(object sender, EventArgs e)
{
myTimer.Tick += new EventHandler(myTimer_Tick);
myTimer.Interval = 2000;
myTimer.Enabled = true;
}
void myTimer_Tick(object sender, EventArgs e)
{
MessageBox.Show("tick");
}
|
|
|
|
|
Yes indeed
Thank you very much
|
|
|
|
|
See my reply to the above answer if you find that it does not work as you want it too
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
I want to open Firefox ever hour!
void myTimer_Tick(object sender, EventArgs e)<br />
{<br />
System.diragnostic.process.start("firefox);<br />
}<br />
static void Listen()<br />
{<br />
<br />
<br />
while (true)<br />
{<br />
try<br />
{<br />
data = new byte[1024];<br />
received = networkStream.Read(data, 0, data.Length);<br />
if (received == 0)<br />
break;<br />
<br />
string get = Encoding.ASCII.GetString(data, 0, received);<br />
var send = get.ToByteArray();<br />
//Console.WriteLine("Received from TCP Client: " + get);<br />
networkStream.Write(send, 0, send.Length);<br />
<br />
<br />
if (get == "rstartFirefox")<br />
timer1.Tick += new EventHandler(myTimer_Tick);<br />
timer1.Interval = 3600000; // once every two seconds<br />
timer1.Enabled = true;
here it doesn´t work! the code works great by a Button_Click!
What can i do that it works here?
|
|
|
|
|
start by moving the following two lines to your constructor, and use it no where else
timer1.Tick += new EventHandler(myTimer_Tick);
timer1.Interval = 3600000
then after all the code you have posted add the following line to check what going on..
MessageBox.Show("get = " + get);
let me know what pops up and how many times.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Nothing!
Now i have it so!
I get the massage box!
Open also takes the correct value!
But he don´t open the Methode myTimer_Tick!
What can i do?
<br />
public Form1()<br />
{<br />
InitializeComponent(); <br />
}<br />
void myTimer_Tick(object sender, EventArgs e)<br />
{<br />
mciSendString("set CDAudio door open", null, 127, (IntPtr)0); <br />
}
if (get.Contains("rRegelmaessig_oeffnen"))<br />
{ <br />
Messagebox.show("Hello");<br />
string[] get_Split2 = get.Split('~');<br />
int open = Convert.ToInt32(get_Split2[1]);<br />
timer1.Tick += new EventHandler(myTimer_Tick);<br />
timer1.Interval = open * 1000; <br />
timer1.Enabled = true; <br />
}
|
|
|
|
|
what is the value of open?
How do you know that the Tick event is not being called?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
you should not add the event handler in the button click event as you will get a new handler added each time you press the button. So in your example the message box will be shown the same number of times that the button has been clicked.
Just need to take out the adding of the event handler and put that line in the design code, or constructor, or anywhere it will only be called once.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Dear,
Every new form, I've to import using system.data.oledb. Is there anyways to make it default every new form?
Thanks,
Chuon Visoth
Angkor Wat - Cambodia
asp.net - c sharp beginner
|
|
|
|
|
Hi,
you cannot "import" the using statement automatically. But if you access everthing full qualified (e.g. System.Data.OleDb.DbConnection...) you don't need the using statement.
Don't know if I get your question right. The using-statement is just something like "syntactic sugar". It is just there to access classes within a namespace without using the fully qualified method. It is nothing like an "import".
Regards
Sebastian
|
|
|
|
|
got it!
thanks,
Chuon Visoth
Angkor Wat - Cambodia
asp.net - c sharp beginner
|
|
|
|
|
Yup
You can create "project" and "item" templates for re-use. Create a new project, add your references and choose "File", "Export Template". Export the project-template, and it will appear under "File/New" once you put it in the "\Templates" folder of Visual Studio (see "My Documents")
If you only want a form, and not a complete project, then add the using and start the export-wizard again. Select your form, export as a template and save the generated template under "My Documents\Visual Studio 2008\Templates\ItemTemplates\Visual C#"
I are Troll
|
|
|
|
|
Yes, but you have to either provide your own template or modify the MS ones.
Your own is easy: create an example of the form you want, and save it as a template in "My Documents\Visual Studio 2008\Templates\ItemTemplates\Visual C#"
Modifying the MS ones is also easy, but back them up first! Go to "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplatesCache\CSharp\Windows Forms\1033\Form.zip" and edit the the form.cs file. Add your using statements and save. Add...new...Windows Form will now include your stuff.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
The other answers are correct, but... your Form should not be accessing the database directly; write (at least) a Data Access Layer and then access that from your form.
|
|
|
|
|
Hi all,
Some one please can help me by converting the following code.
This works fine for the frames. and how to do for the other tags like button and links
The following code for frames works fine:
HTMLDocument document;
IHTMLElementCollection elcol = document.getElementsByTagName("iframe");
foreach (IHTMLElement iel in elcol)
{
HTMLFrameElement frm = (HTMLFrameElement)iel;
DispHTMLDocument doc1 = (DispHTMLDocument)((SHDocVw.IWebBrowser2)frm).Document;
DE = (HTMLDocumentEvents2_Event)doc1;
DE.onclick += new HTMLDocumentEvents2_onclickEventHandler(DE_onclick);
}
But i dont know how to do for the input buttons. Can you help me how to proceed with the following code.
IHTMLElementCollection buttons = document.getElementsByTagName("INPUT");
foreach (IHTMLInputElement iel in buttons)
{
HTMLInputElement button = (HTMLInputElement)iel;
//What to implement here to trigger the event that should contain IHTMLEventObj pEvtObj arguement
}
thanks in advance and awaiting for the solution...
|
|
|
|