473,563 Members | 2,653 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FTP en ASP Classic

1 New Member
Voici un exemple de script en PowerShell qui accède au FTP. Pour le FTP d'un AS400, l'astuce est d'ajouter le « %2f » qui permet de basculer en « Site NameFmt 1 » automatiquement .

Quelqu'un pourrait me convertir ce code en « ASP Classic » ?


Expand|Select|Wrap|Line Numbers
  1. $ftpPath = "ftp://SvrAS400/%2fPARTAGE/"
  2. $ftpUser = "utilisateur"
  3. $ftpPass = "motdepasse"
  4.  
  5. $WebClient = New-Object System.Net.WebClient
  6. $WebClient.Credentials = New-Object System.Net.NetworkCredential($ftpUser,$ftpPass)
  7. $WebClient.BaseAddress = $ftpPath
  8.  
  9. $Request = [Net.FtpWebRequest]::Create($ftpPath)
  10. $Request.Credentials = $webclient.Credentials
  11. $Request.Method = [System.Net.WebRequestMethods+FTP]::ListDirectory
  12. $Request.UseBinary = $False
  13. $Request.KeepAlive = $False
  14.  
  15. $Response = $Request.GetResponse()
  16. $ResponseStream = $Response.GetResponseStream()
  17.  
  18. $StreamReader = New-Object System.IO.Streamreader $ResponseStream
  19. $DirListing = (($streamReader.ReadToEnd()) -split [Environment]::NewLine)
  20. $StreamReader.Close()
  21.  
  22. $Response.Close()
  23. $DirListing
Dec 8 '22 #1
0 7585

Sign in to post your reply or Sign up for a free account.

Similar topics

16
2045
by: Simon Wittber | last post by:
I've noticed that a few ASPN cookbook recipes, which are recent additions, use classic classes. I've also noticed classic classes are used in many places in the standard library. I've been using new-style classes since Python 2.2, and am suprised people are still using the classic classes. Is there a legitimate use for classic classes...
6
1876
by: Keith | last post by:
I have been using ASP in it's VBScript form for some time, but I only tend to learn what I need to know as I need to know it, so I am by no means an expert and spend a lot of time on here asking quesitons of all you helpful people. However, I have decided it's probably time to actually take teh time to properly learn ASP. Now ASP.net is...
5
2936
by: Velvet | last post by:
Can someone tell me to what process I need to attach to be able to step through my classic ASP code in VS.net 2003. I'm working on an XP box with IIS installed. I also have VS.net 2005 (The final, never installed beta) installed on this box if it makes a difference (I did not install VS Development Web Server as I'm already using the XP web...
6
1844
by: John | last post by:
Hello. I believe I've read somewhere that classic .asp pages will still operate correctly with no problems with the .NET 1.1 framework installed on a Windows 2000 Server server. Does anyone know if the same classic .asp pages will work on the .NET 2.0 framework with no problems? I was going to start moving towards the .NET technology but...
5
2299
by: Kent.Gallinger | last post by:
I have a web application that contains asp.net and classic asp pages. I have a vb.net function that I would like to use in one of the classic asp pages. How can I do this? Can I do this? Thanks, Kent.
24
5472
by: MikeR | last post by:
What do y'all see for the future of ASP in light of MS decision to replace FrontPage with a new series of development tools? All of them mention ASP.NET, but no mention of the ASP I love. Mike
11
2287
by: mase | last post by:
I've built a new ASP.NET web app with the CSLA framework. The site runs fine with a small number of users, but once there is any traffic the CPU spikes at 100%. I went through and made many updates to plug various memory leaks. Glad that I did that and it probably helped out some, but the issues still exists. The application was built the...
0
7664
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7885
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7638
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6250
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3642
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.