|
I'll add my 50 to that, and she can clean my drive when she's finished your yard.
|
|
|
|
|
|
Hi Guys,
I am working on a console app which telnets to a linux server. Now this linux server ask for a username and password which i try to send via my code. Now everything works up until the SendKeys.SendWait() - it seems that the window does not react to the "Enter" command. I have tested this with some other telnet servers, which are not linux and they work. Any help or if any other work around are available I am open for anything.
My issue is - I have a system built by ADP and would like to grab data from them and put it into my on db to process. However, their system is closed and the solution I came up with is to screen scrape what I need. If you guys know something alredy out there or can point in the write direction it would be great.
Thanks ahead of time.
public string Login(string Username,string Password,int LoginTimeOutMs)
{
int oldTimeOutMs = TimeOutMs;
TimeOutMs = LoginTimeOutMs;
string s = Read();
while(s == "" )
s = Read();
Console.Write(s);
if (!s.TrimEnd().EndsWith(":"))
throw new Exception("Failed to connect : no login prompt");
Console.Write(Username);
SendKeys.SendWait("{ENTER}");
|
|
|
|
|
Not sure I can help, but I wrote a telnet client to do similar stuff (connect to a SCO UNIX box and manipulate a third-party character-based application). I had to create a script language for it. A Windows Service would cobble up the necessary script and run it.
A sample script to log onto a server, execute ps -a , and disconnect:
<login:
@someserver
<Password:
>myusername
<TERM
>mypassword
<$
>
>ps -a
$exit
The important bits are:
System.Net.Sockets.TcpClient
System.Net.Sockets.NetworkStream
Anyway, I didn't use SendKeys, I simply used Read and Write on the stream.
I would have written an article on it, but the handling of telnet options isn't quite right.
|
|
|
|
|
I am working on a similar project. (ADP) I have some code that may work for you. I am also having an issue. My problem is I have a form with a textbox and a button. I need to be able to fill out the textbox push the button and send the textbox string to the telnet-console application to perform the task. I have built the form and have found code for the telnet-console application. I can logon successfully and perform a download with the telnet-console code. My problem is having the form communicate and trigger the telnet-console application. I would appreciate any help you could give.
Thank you,
GerosDS
|
|
|
|
|
Hello
I'm looking for a good tutorial about user control
I need to learn the purpose (I have an idea) and how to design it
Thank you for your suggestions / Help
|
|
|
|
|
|
This not really a tutorial !
|
|
|
|
|
baranils wrote: This not really a tutorial
If that tutorial was not good enough for you, what sort of tutorial are you looking for?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Try doing an article search on this site. Some good ones are bound to pop up
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
It's a joke ?
I make severall search here
Nothing interesting pop-up
I've tried :
user control tutorial
use control design
|
|
|
|
|
|
tutorials i dont know (tell me if you find a good one), but i ussually use usercontrol to fill up form like pages, that way i avoid creating many forms, you may try that later on.
About using usercontrols for creating buttons, i never needed so far, but there are here in codeproject article that teach you how to create a particular usercontrol like a button or a combobox or a calendar, better you download one of those!
keyword: create usercontrol button calendar
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Thank you nelsonpaixao
Yest I need a complex control to provide address searching
A feew combo, textbox etc
Not a simple button
I will continue to investigate how to do it well
|
|
|
|
|
You don't really need a tutorial, just have a go!
1. Create a test winforms app, right click and choose Add|User Control.
2. Handle any events from the controls just like you would in a form.
3. If you need to override any of the built in methods so it reacts externally in a different way then use the override keyword to override any of the base's virtual methods.
4. You can create your own properties, methods and events. If any conflict with the base's ones and they're not overridable, use the new keyword or rename your own to avoid the conflict.
That's about it really. By deriving from UserControl (or Control or Component) MS have already done the hard work for you.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
I've got a menu form , in witch i have 4 choises to make , each reprezented by another form .
I'm willing to close the menu form when i chose to open another form . And then also to be able to close the selected form and to re-run the menu form ,if i wish .
I want to CLOSE it , not to hide it or anything .. I've been google'ing it , but i've got no clue , nothing i try don't seem to work .
Please help ..
|
|
|
|
|
Why don't you just look into an MDI environment. The switch for a WinForms to go to MDI is fairly simple.
Regards,
Thomas Stockwell
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.
Visit my Blog
|
|
|
|
|
You need to put your main() method and overall control logic in a separate controller class. Then ControllerClass creates a MenuForm . When the user clicks the Form1 Button on MenuForm , instead of opening Form1 directly, it notifies ControllerClass . ControllerClass then closes MenuForm and Creates Form1 . Likewise, the OnClosing event for Form1 signals the fact to ControllerClass which then either opens a new MenuForm or terminates the application.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
dan neely , i officially love you ! thanx !!
|
|
|
|
|
|
I see , but my application is not chat-like , and i decided that the other idea is more suitabble . My deisgn might be wrong , i'm still a beginner , so i'll consider this idea for the future , just in case
p.s. i already know how to use delegates , don't offend me man :p
Thank you all !
|
|
|
|
|
listen,
i dont have any degree on computer programming so i don´t really know the learning path, just telling that because i started with the idea of creating many form and droped it. After i started to use that usercontrols method and i needed to learn about delegates.
Besides that try also mdi parent child forms, not just for chats use like said, because parent form ownes child forms you don´t need that "public" stuff or delegates to call the form.
There is a good article here about that, use the keywords i said before, i think is an articles that as pictures of a cartoon; heidi.
Sorry i dont remember the author i think is the best article mdi forms, so search it.
nelsonpaixao@yahoo.com.br
trying to help & get help
modified on Friday, October 3, 2008 7:19 PM
|
|
|
|
|
I am loading a html pages in my first webbrowser control and right after that I am loading another webbrowser control which loads the same pages as the first one already loaded. Everythings seems ok but sometimes all of sudden documents weren't loaded and in 1st webbrowser control and i get the html default error page. so how can i load only the 2nd webbrowser control in the background thread once the first one has been completed loaded.
Thanks
|
|
|
|
|
I have been trying to detect when the power button has been pressed on a system (winXP) however so far i have been unsuccessful. I have tried useing WMI and monitoring the Win32_PowerManagementEvent but i only seem to be able to pick up a battery insertion/removal on a laptop and on a desktop it doesn't pick up anything. Is it actually possible to detect the button press and if so can some one point me in the direction of how to do it?
Thanks for any assistance offered,
P
|
|
|
|
|
Well, no. You could make your application detect an abnormal program exit by setting a value in a data file when the program starts, and then un-setting it when the program exists normally, and performing a specific task depending on the presence/absence of that setting. Consider that the user could just hit the hard reset button as well, so technically, the machine has been turned off and then back on.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|