|
-
February 3rd, 2010, 12:09 AM
#1
Command Prompt
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.....
-
February 3rd, 2010, 06:44 PM
#2
Re: Command Prompt
Code:
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:
Code:
lngINetConn = InternetConnect(lngINet, “ftp.microsoft.com”, 0, _
“anonymous”, “[email protected]”, 1, 0, 0)
That assigns to a variable:
Code:
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:
Code:
blnRC = FtpGetFile(lngINetConn, “dirmap.txt”, “c:\dirmap.txt”, 0, 0, 1, 0)
Stores a file:
Code:
Private Declare Function InternetCloseHandle Lib "wininet.dll" (ByVal hInet As Long) As Integer
Defines the API:
Code:
InternetCloseHandle lngINetConn
InternetCloseHandle lngINet
And, closes the file
Or, try this: http://www.15seconds.com/component/pg001109.htm
-
February 18th, 2010, 12:21 AM
#3
Re: Command Prompt
 Originally Posted by dglienna
Code:
Private Declare Function InternetOpen Lib "wininet.dll"
Thanks Alot for the reply....................
Last edited by Cimperiali; February 22nd, 2010 at 07:10 PM.
Reason: added missed endings tags
-
February 18th, 2010, 07:19 AM
#4
Re: Command Prompt
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
-
February 20th, 2010, 08:38 PM
#5
Re: Command Prompt
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|