473,386 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

control dial up connection

Dear all,

I need to writte a VB application that establish a dial up connection to the
internet, upload and file on a ftp, then close the connection.

what's the easiest way to do it ?

Thanks for help,
Loïc

Nov 20 '05 #1
2 1756
Hi News,

I do not know however one of the places I first would look at,

Net Component
http://www.indyproject.org/indy.html

I do not know it it helps, however maybe a little bit.

Cor

Nov 20 '05 #2
"news dur Wanadoo" <lo*****@free.fr> wrote in message
news:c6**********@news-reader1.wanadoo.fr...
Dear all,

I need to writte a VB application that establish a dial up connection to the internet, upload and file on a ftp, then close the connection.

what's the easiest way to do it ?

Thanks for help,
Loïc


My apologies for not converting this dialup code to VB, but it is at least a
pointer in the right direction :)

http://authors.aspalliance.com/aldot...translate.aspx should help
with the conversion...

The indy project at http://www.indyproject.org/ has a ftp client that should
work for the rest.

// Requires IE >= v5.0

using System;
using System.Runtime.InteropServices;

public class RASDialup
{

[DllImport("wininet.dll",CharSet=CharSet.Auto)]
public extern static int InternetDial(

IntPtr hwnd,

[In]string lpszConnectoid,

uint dwFlags,

ref int lpdwConnection,

uint dwReserved

);

[DllImport("wininet.dll",CharSet=CharSet.Auto)]

public extern static int InternetHangUp(

int lpdwConnection,

uint dwReserved

);

public enum DialUpOptions

{

INTERNET_AUTODIAL_FORCE_ONLINE = 0x0001,

INTERNET_AUTODIAL_FORCE_UNATTENDED = 0x0002,

INTERNET_DIAL_FORCE_PROMPT =0x2000,

INTERNET_DIAL_SHOW_OFFLINE =0x4000,

INTERNET_DIAL_UNATTENDED =0x8000

/*

INTERNET_AUTODIAL_FORCE_ONLINE Forces an online connection.

INTERNET_AUTODIAL_FORCE_UNATTENDED Forces an unattended Internet dial-up. If
user intervention is required, the function will fail.

INTERNET_DIAL_FORCE_PROMPT Ignores the "dial automatically" setting and
forces the dialing user interface to be displayed.

INTERNET_DIAL_UNATTENDED Connects to the Internet through a modem, without
displaying a user interface, if possible. Otherwise, the function will wait
for user input.

INTERNET_DIAL_SHOW_OFFLINE

*/

}

int m_connectionnumber;

public int ConnectionNumber

{

get { return m_connectionnumber; }

}

public int Connect(string m_ConnectionName)

{

int retVal = InternetDial(IntPtr.Zero, m_ConnectionName, (uint)
DialUpOptions.INTERNET_DIAL_UNATTENDED, ref m_connectionnumber, 0);

return retVal;

}

public void Disconnect()

{

InternetHangUp(m_connectionnumber, 0);

}

}
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: sleepyant | last post by:
Hi, I've posted this question on several forum but have no response. So I hope anyone who have any idea what I'm talking about please give your solution or advice. My problem is I need to check...
1
by: John Morgan | last post by:
I am using a dial up connection to the Internet and to an online SQL Server database. I have a problem in that when I use Enterprise Manager to access even my local server , or even, it...
10
by: sleepyant | last post by:
Hi, I've posted this question on several forum but have no response. So I hope anyone who have any idea what I'm talking about please give your solution or advice. My problem is I need to check...
4
by: Anjan Bhowmik | last post by:
I want to query the dial up connections present in the system, which will host my application. My user want to connect automatically to the internet if the dialup connection was hanged. Ho do...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.