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

FTP en ASP Classic

1
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 7547

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

Similar topics

16
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...
6
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...
5
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...
6
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...
5
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? ...
24
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
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.