gpt4 book ai didi

powershell - 从远程FTP服务器上的文件获取日期

转载 作者:行者123 更新时间:2023-12-03 00:03:56 24 4
gpt4 key购买 nike

要获取文件,该方法如下所示:

$ftprequest.Method = [System.Net.WebRequestMethods+Ftp]::DownloadFile  

因此,我尝试将Method更改为等效于以下C#代码:
request.Method = System.Net.WebRequestMethods.Ftp.GetDateTimestamp;

如何在Powershell中使用GetDateTimestamp?

我已经尝试了以下变体而没有任何运气:
$ftprequest.Method = [System.Net.WebRequestMethods+Ftp.GetDateTimestamp]
$ftprequest.Method = [System.Net.WebRequestMethods+Ftp+GetDateTimestamp]
$ftprequest.Method = [System.Net.WebRequestMethods.Ftp.GetDateTimestamp]
$ftprequest.Method = [System.Net.WebRequestMethods.Ftp+GetDateTimestamp]

额外的问题:第一个代码示例的::意思是什么?

谢谢!

最佳答案

这似乎可行:

$ftprequest.Method = [System.Net.WebRequestMethods+Ftp]::GetDateTimestamp
::用于访问共享/静态成员,即 GetDateTimeStamp

关于powershell - 从远程FTP服务器上的文件获取日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13186477/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com