473,320 Members | 1,969 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,320 software developers and data experts.

Connecting to FTP server using WinInet

Hi,
I am trying to connect to esatblish FTP connection using WinInet
APIs.I am on LAN connecting via proxy to internet.

First call InternetOpen() is fine, however the call to
InternetConnect() return error 'The server name could not be
resolved'.I have tried accessing the same site through IE and it works
fine.Also the proxy server 'sproxyname' is correct.
The code snippet is as shown below,

HINTERNET hSession;
hSession = InternetOpen("Microsoft Internet Explorer",
INTERNET_OPEN_TYPE_PROXY ,sproxyname, NULL, INTERNET_FLAG_ASYNC);
if (hSession)
{
HINTERNET hService;
hService = InternetConnect(hSession, "ftp.microsoft.com",
INTERNET_DEFAULT_FTP_PORT, NULL, NULL,
INTERNET_SERVICE_FTP, 0, 0);
}
Please if anybody can help me out in this.

Thanks in advance.
Jul 22 '05 #1
1 4238
"Shweta" <sh*********@wipro.com> wrote in message
news:65**************************@posting.google.c om...
Hi,
I am trying to connect to esatblish FTP connection using WinInet
APIs.I am on LAN connecting via proxy to internet.

First call InternetOpen() is fine, however the call to
InternetConnect() return error 'The server name could not be
resolved'.I have tried accessing the same site through IE and it works
fine.Also the proxy server 'sproxyname' is correct.
The code snippet is as shown below,

HINTERNET hSession;
hSession = InternetOpen("Microsoft Internet Explorer",
INTERNET_OPEN_TYPE_PROXY ,sproxyname, NULL, INTERNET_FLAG_ASYNC);
if (hSession)
{
HINTERNET hService;
hService = InternetConnect(hSession, "ftp.microsoft.com",
INTERNET_DEFAULT_FTP_PORT, NULL, NULL,
INTERNET_SERVICE_FTP, 0, 0);
}
Please if anybody can help me out in this.

Thanks in advance.

Wrong news group, try microsoft.public.win32.programmer.networks

--
Elias
Jul 22 '05 #2

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

Similar topics

0
by: Ratan | last post by:
I am having an C# .Net application which using WinInet api for FTP downloads and its running fine on win 2000 and win xp but giving problem on win 2003 server. It seems to be failing to...
12
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
3
by: BobAchgill | last post by:
When I use this class below it says "Name 'config' not declared" for the following line: Dim sMethod As String = config.AppSettings("DialupMethod") How do I declare this guy? Thanks, Bob
9
by: Ron | last post by:
Hello, Is it required to use Imports System.Runtime.InteropServices to run C++ API code? I ask because I thought I read somewhere that this was required. If it is not required would it...
0
by: Sankalp | last post by:
Hi, I am tryin to create an internet connection and download a particular file from a specified URL programmatically using VB on a WIN 95 machine. The code that I use is as follows: Private...
0
by: Nishini | last post by:
I am using "FtpFindFirstFile" function of wininet.dll in my application. I had the Declare statement for this function in my code but when I executed my applicaiton, it gave me an error saying...
10
by: rup | last post by:
Hello, This is my first application on socket programming in vc++. I am facing problem that how to make connection to server, & make GET/POST request by HTTP. Please help me. Its urgent.......
13
by: Javad | last post by:
Hello I know that I should get the information of windows internet connections by using "rasapi32.dll" library, and I also have some sample codes, but I can't make them work. My exact need is to...
10
by: =?Utf-8?B?TWF0dA==?= | last post by:
I am using the following code to connect to and download files from an ftp server, but the Symantec anti-virus software on some of my customers machines tells them that their computers are...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.