Click to See Complete Forum and Search --> : Command Prompt


prince_XY143
February 2nd, 2010, 11:09 PM
HI ,
i'm new to .net, i'm tring to execute some commands in cmd prompt in vs 2008. can any pls help me.... (with out using BATCH FILE)

i want to execute the following commands....
----> FTP
----> open server name
----> user name
----> pswd
etc....

thanks in advance.....

dglienna
February 3rd, 2010, 05:44 PM
Private Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" _
(ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String, _
ByVal sProxyBypass As String, ByVal lFlags As Long) As Long



Defines the API:

lngINetConn = InternetConnect(lngINet, “ftp.microsoft.com”, 0, _
“anonymous”, “wally@wallyworld.com”, 1, 0, 0)


That assigns to a variable:

Private Declare Function FtpGetFile Lib "wininet.dll" Alias "FtpGetFileA" _
(ByVal hFtpSession As Long, ByVal lpszRemoteFile As String, _
ByVal lpszNewFile As String, ByVal fFailIfExists As Boolean, _
ByVal dwFlagsAndAttributes As Long, ByVal dwFlags As Long, _
ByVal dwContext As Long) As Boolean



Will get a file:

blnRC = FtpGetFile(lngINetConn, “dirmap.txt”, “c:\dirmap.txt”, 0, 0, 1, 0)

Stores a file:

Private Declare Function InternetCloseHandle Lib "wininet.dll" (ByVal hInet As Long) As Integer


Defines the API:

InternetCloseHandle lngINetConn
InternetCloseHandle lngINet


And, closes the file

Or, try this: http://www.15seconds.com/component/pg001109.htm

prince_XY143
February 17th, 2010, 11:21 PM
Private Declare Function InternetOpen Lib "wininet.dll"



Thanks Alot for the reply....................

HanneSThEGreaT
February 18th, 2010, 06:19 AM
prince_XY143, I have noticed that you are struggling to Quote somebody. You will see at the bottom right of each post, there is a button labelled Quote, it is next to the Edit button. That is all you have to click :)

Cimperiali
February 20th, 2010, 07:38 PM
what's wrong with ftpwebRequest?
http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx
http://msdn.microsoft.com/en-us/library/b7810t5c.aspx