Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1987934
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T08:45:23+00:00 2026-05-17T08:45:23+00:00

I’m trying to find a simple way of checking user stats via FTP, wininet

  • 0

I’m trying to find a simple way of checking user stats via FTP, wininet seems to be the best option.
How do I get the output from the command though?

Private Declare Function InternetCloseHandle Lib "wininet.dll" (ByVal HINet As Integer) As Integer
Private Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Integer, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags As Integer) As Integer
Private Declare Function InternetConnect Lib "wininet.dll" Alias "InternetConnectA" (ByVal hInternetSession As Integer, ByVal sServerName As String, ByVal nServerPort As Integer, ByVal sUsername As String, ByVal sPassword As String, ByVal lService As Integer, ByVal lFlags As Integer, ByVal lContext As Integer) As Integer
Public Declare Function ftpCommand Lib "wininet.dll" Alias "FtpCommandA" (ByVal hConnect As Integer, ByVal fExpectResponse As Boolean, ByVal dwFlags As Integer, ByVal lpszCommand As String, ByRef dwContext As Integer, ByRef phFtpCommand As Integer) As Boolean

Dim INet, INetConn As Integer

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    INet = InternetOpen("MyFTP", 1, vbNullString, vbNullString, 0)
    INetConn = InternetConnect(INet, "192.168.1.6", 21, "user", "pwd", 1, 0, 0)

    strCommand = "SITE SHOW SERVER 192.168.1.6.21"

    Dim retv As Long
    Dim Test = ftpCommand(INetConn, True, 2, strCommand, 0, retv)
    Debug.Write(Test)

    InternetCloseHandle(INetConn)
    InternetCloseHandle(INet)

End Sub

The output I’m expecting is:

Response:   200- Server IP = "192.168.1.6"
Response:   200- Port = "21"
Response:   200- Start time = "10/02/2010  02:46:57 PM"
Response:   200- Download = "0.000 KB"
Response:   200- Upload = "0.000 KB"
Response:   200- Online Users = "0"
Response:   200-======================================
Response:   200 Site command OK

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T08:45:24+00:00Added an answer on May 17, 2026 at 8:45 am

    I think you may find use of InternetGetLastResponseInfo which is a link to the c++ definition

    (found this by navigating the WinINet function list) but provides a useful hint

    it says:

    InternetGetLastResponseInfo Function

    Retrieves the last error description or server response on the thread calling this function.

    Consider this sample implementation

    Private Function GetServerResponse() As String
        Dim lError As Long
        Dim strBuffer As String
        Dim lBufferSize As Long
        Dim retVal As Long
        retVal = InternetGetLastResponseInfo(lError, strBuffer, lBufferSize)
        strBuffer = New String("", lBufferSize + 1)
        retVal = InternetGetLastResponseInfo(lError, strBuffer, lBufferSize)
        GetServerResponse = strBuffer
    End Function
    

    Which calls the external function (here for copy paste access)

     Declare Function InternetGetLastResponseInfo Lib "wininet" Alias "InternetGetLastResponseInfoA" (ByRef lpdwError As Long, ByVal lpszBuffer As String, ByRef lpdwBufferLength As Long) As Boolean
    

    twice, once to get the buffer length and again to fill the buffer string then returns the filled buffer

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to select an H1 element which is the second-child in its group

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.