Solved

Shell syntex & Dial-up monitoring

Posted on 1998-06-16
6
254 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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 100 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

809 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