?
Solved

Shell syntex & Dial-up monitoring

Posted on 1998-06-16
6
Medium Priority
?
260 Views
Last Modified: 2013-11-13
Two Questions: 1) Is it possible with the Shell command to allow command line
arguments to be taken from a Textbox? Example: Shell("App.exe "Text1", 1)
Text1 being user input data to be added to the Shell command line. I noticed
that Shell command won't read it?

2) I like a reliable method for dialing & monitoring the winsock connection 98/NT
and if lost, redial any number of times till the connection is re-established. While
the connection is active, ping every 5 mins incase of inactivity to prevent premature disconnection.

Looking forward to a wonderful reply from one of you VB guru's.
0
Comment
Question by:Capital1
  • 3
  • 2
6 Comments
 

Author Comment

by:Capital1
ID: 1463374
Edited text of question
0
 

Author Comment

by:Capital1
ID: 1463375
Edited text of question
0
 
LVL 18

Expert Comment

by:deighton
ID: 1463376
Shell("App.exe " +  Text1, 1)
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 2

Expert Comment

by:Biffo
ID: 1463377
Proper syntax for what you want is to predfine the commands outside of the shell command line or VB will trip out and puke:

'Besure to add a extra space with last  " to space the Text1 input out
EX = "App.exe " & Text1
'Then go ahead and Shell as:

Shell(EX, 1)

0
 
LVL 2

Accepted Solution

by:
Biffo earned 400 total points
ID: 1463378
I'm sorry, I should had answered your questioned when I commented earlier on your Shell question.  I'll cover your question #2 since internet programming is one of specialities.

There is a number of ways of accomplishing what you want, some more involved than others. I'll direct you to perhaps the most straight forward way and by far the most easiest and best documented. Go to Catalyst Developement home web site at: www.catalyst.com and download
their SocketWrench kit. Note: SocketWrench, not their SocketTool kit since that cost $$ to use whereas SocketWrench is FREE and you can do whatever you want with it.

Install. It comes with CSRAS32.OCX and CSPING32.OCX. Load the sample VB5 Stdialer form, you can work off that as your project. Essentially you can follow your nose with developing it with the help topics that come with it to your needs. Example to have it reconnect automatically when disconneted you could add this to the form:


Private Sub Dialer1_Disconnect()
   
    If Dialer1.Connected = False Then
    Call ActionButton_Click
    End if

If you have AutoUpdate in properties set to True, then as soon as it loses connection it will immediately redial. AutoUpdate monitors the connection every second I beleive with the default interval setting.  You can then drop in the CSPING32.OCX  and set the interval to whater you like, say ping every 2 or 5 minutes with some code like:

Private Sub PingHostAddress()
    'Start up the Ping control on a host

    Ping1.hostaddress = hostaddress
    Ping1.Blocking = True
    Ping1.Interval = 1000
    Ping1.Enabled = True

End Sub

See the Netcheck sample project for ping info and usage.  This will do it, you will be able to build a dialer and have it do whatever you want using SocketWrench.

 -Jim

0
 

Author Comment

by:Capital1
ID: 1463379
Great !!!!!!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses
Course of the Month15 days, 23 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question