|
okay I should put a timer of interval 1000 and in Tick event a Request and a Response will happen...so wont the application take too many system resources ?
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
1000 = 1 second.
60 ticks per minutes, makes 3600 per hour.
don't you think that's why to much?
no for the computer it's pratically nothing in recources.
i used to run more than 30 instances of the same application each consuming more than 30mb ram.
Second life ---> libsecondlife.org
but depending on the webhost you have, they count the traffic.
atleast mine does, www.web.com
if you own the webserver and traffic is not an issue, use PERL, Phyton or something and write an application outside of the webserver.
than your problem is solved and you can have a live connection.
smart people use a SQL table as ram, a RAM table, you can create ram table(mysql, sqlite, etc, etc, do this), but you can use an ordinary table and do the same.
so you application aswel the webserver can acces this table.
Bad = knowing 2 much
|
|
|
|
|
|
HTMLDoc = (HTMLDocument)WebBrowser.Document;
iHTMLCol = HTMLDoc.getElementsByTagName("input");
//type the username in the text box
mshtml.HTMLElementEvents2_Event htmlElementEvents2_Event = null;
foreach (IHTMLElement iHTMLEle in iHTMLCol)
{
try
{
strAttriName = iHTMLEle.getAttribute("id", 0).ToString();
if (strAttriName == "go")
{
if (iHTMLEle != null)
{
if (iHTMLEle is mshtml.HTMLButtonElement)
{
htmlElementEvents2_Event = (mshtml.HTMLElementEvents2_Event)iHTMLEle.onclick ;
htmlElementEvents2_Event.onclick += new HTMLElementEvents2_onclickEventHandler(htmlElementEvents2_Event_onclick);
}
}
}
}
catch { }
}
}
See the code above.
i have one button in my browser (intternetExplorer object), on that button click i wanted to call a method or event method.
Could any buddy help me out it is argent.
Thanks in advance!
yogesh
|
|
|
|
|
hi guys , i`m new in C# and now have a problem
i wanna open a web page , then get it`s form (my perpose page has 1 form)
then fill the form , and click the button !
the textbox of user name , is named : "e5ba6b5"
see , i did this :
webBrowser1.Navigate("http://mysite.com");
HtmlElementCollection htm = webBrowser1.Document.Forms;
HtmlElementCollection user = htm.GetElementsByName("e5ba6b5");
is it true ?!
and how should i fill username and click the button ?!
|
|
|
|
|
|
Do you have to use C# for this? I do things like this a lot, as I write test automation suites for websites.
I would use the AutoITv3 scripting language, http://www.autoitscript.com. It should take you all of ten minutes to do something simple like this, and the scripts compile directly .exe.
Take a look
|
|
|
|
|
If i want to create an application without any console and without any form that for example:
1. every 20 hours send an email
2. backup some folder or doing anything without the user interaction.
3. Will write a log to a file.
4. will run a process if some event occur.
I know that i can make a form application but then i need to mark the form with 0% Opacity. That will take a lot of memory for the process.
What is the best way?
|
|
|
|
|
write it as service. But why do you need such app. Such app can be easly considered malicious programs
|
|
|
|
|
Thanks.
I need it to backup files in my system and to sync between some computer in my office.
|
|
|
|
|
Then i suggest writing it so that it will move to system tray
|
|
|
|
|
Why not try chucking it in the system tray?
Regards,
Jason Pezzimenti.
If you liked the answer that I have provided, then please click the 'Good Answer' link on the bottom-right of this post. Thank you.
|
|
|
|
|
you can't make an application without a window.
but you can hide it.
you can make a DLL and hook it windows explorer, like a service or something.
but don't ask me how to do it, because i never tried
Bad = knowing 2 much
|
|
|
|
|
Natural_Demon wrote: you can't make an application without a window.
That is only expection for service. They don't have any window.
|
|
|
|
|
Your sig says it all - you are quite wrong. A windows/web service does not cannot have a form.
This is lousy advice, although admitting you have no idea at least puts it in context. Please be a little more careful about what advice you give. If you had been the first responder and the asker was a newbie then you may have damaged a potential developer.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
eh, i remember i asked the same question when i played with MFC c++ 5,6 years ago.
it's impossible for an normal application to operate without a form/cmd.
than as solution, i said, you can write a DLL and hooked it the windows explorer, be it as service or something else, like a virus.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Threading;
namespace nowindow_application
{
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Thread.Sleep(1000);
Main();
}
private static int bobo(int a, int b)
{
return (a + b);
}
}
}
this application wil not not produce an executable file using visual studio 2008
//MessageBox.Show(bobo(1, 2).ToString(), "", MessageBoxButtons.OK, MessageBoxIcon.Information);
uncomment this file and you have a executable file in your bin folder.
so you can't build a application without a CMD or form layout.
i dind't spread any false hope or something, i asked this question before.
Bad = knowing 2 much
|
|
|
|
|
or try to compile this
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Threading;
namespace nowindow_application
{
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
bobo(1, 2);
Thread.Sleep(1000);
Main();
}
private static int bobo(int a, int b)
{
return (a + b);
}
}
}
Bad = knowing 2 much
|
|
|
|
|
Hi,
What's your point here? Apart from the recursive call to Main there is nothing that would prevent your example from running to completion.
When a program is compiled as a console application then a window, the console, is always created. Counter intuitively a windows application only has a message loop and window if the programmer writes the appropriate code, usually
Application.Run(new Form1());.<br />
A simple windowless windows application does not show in the taskbar but will be present in Task Manager's process list.
static void Main() {
System.IO.File.AppendAllText(
"log.txt",
"NoWindow started at " + System.DateTime.Now.ToString() + System.Environment.NewLine);
System.Threading.Thread.Sleep(20 * 1000);
System.IO.File.AppendAllText(
"log.txt",
"and ended at " + System.DateTime.Now.ToString() + System.Environment.NewLine);
}
Alan.
|
|
|
|
|
hi, i have been playing with you code.
i tried with threading and other methods.
creating endless/limited loops.
again ....
whitout System.Threading.Thread.Sleep(20 * 1000); or
MessageBox
you code want compile, wel it doesn't produce an executable.
i have achieved 99% cpu usage on a intel 9450.
i think this is a very lousy methode off programming.
to get something valueble on this methode of programming.
static void Main()
{
begin:
if (!testLoop())
{
goto begin;
}
}
private static bool testLoop()
{
while (baba != 101)
{
baba++;
}
baba = 0;
return false;
}
this code comsumes 25% cpu usages and is self sustainable.
but it doesn't produce an executable.
but if you uncomment System.Threading.Thread.Sleep(1 * 1000);
it wil compile but terribly remove the realtime feeling.
it's like imitating the Assembler
Bad = knowing 2 much
|
|
|
|
|
Hello!
Everthing works, but he don´t open myTimer_Tick!!!
open takes the value from the textbox, then * 1000 = 5sec!
public Form1()<br />
{<br />
InitializeComponent(); <br />
}<br />
<br />
void myTimer_Tick(object sender, EventArgs e)<br />
{<br />
System.Diagnostics.Process.Start("winword"); <br />
}
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 />
networkStream.Write(send, 0, send.Length);<br />
<br />
if (get.Contains("open_ever_x_sec"))<br />
{ <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;
timer1.Enabled = true; <br />
}<br />
|
|
|
|
|
are you sure that this condition is true
if (get.Contains("open_ever_x_sec"))
put a break point in there and see if it get called or not. If it does then check that is Tick event attached with timer1 and what is the value of open
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
yes it get called!
And open takes the correct value!
He doesn´t open myTimer_tick!!!!
|
|
|
|
|
It suppose to get called, btw write following line after InitializeComponents()
timer1.Tick += new EventHandler(myTimer_Tick); and remove from while loop.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
|
try adding
timer1.Start();
check if VS didn't already assign event handler
If that doesn't work, try this:
Timer time1 = nre Timer();
time1.Tick += new EventHandler(myTimer_Tick);
time1.Interval = 2 * 1000;
time1.Enabled = true;
modified on Saturday, August 22, 2009 6:38 AM
|
|
|
|