- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我必须使用 C# 应用程序 (.NET 3.5) 在使用 TLS 的 FTP 上上传一些文件。使用 FileZilla,没问题。
现在,在我的 C# 代码中,我得到了这个异常:
The remote server return an error : 234 AUTH TLS OK.
我真的不知道为什么,因为 FileZilla 一切正常。
这是我的代码:
public static bool AcceptAllCertificatePolicy(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
return true;
}
public static string Upload_SSL(string filenameSrc)
{
ServicePointManager.ServerCertificateValidationCallback = AcceptAllCertificatePolicy;
FileInfo fileInfSrc = new FileInfo(filenameSrc);
FtpWebRequest reqFTP;
// Create FtpWebRequest object from the Uri provided
if (strDirectory.Trim() != "")
{
reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + strHost.Trim() + "/" + strDirectory.Trim() + "/" + fileInfSrc.Name.Trim()));
}
else
{
reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + strHost.Trim() + "/" + fileInfSrc.Name.Trim()));
}
// Provide the WebPermission Credintials
reqFTP.Credentials = new NetworkCredential(strUser.Trim(), strPass.Trim());
reqFTP.EnableSsl = true;
// Test Fabio du 15/01/2013
reqFTP.Proxy = null;
// By default KeepAlive is true, where the control connection is not closed
// after a command is executed.
reqFTP.KeepAlive = false;
// Specify the command to be executed.
reqFTP.Method = WebRequestMethods.Ftp.UploadFile;
// Specify the data transfer type.
reqFTP.UseBinary = true;
// Notify the server about the size of the uploaded file
reqFTP.ContentLength = fileInfSrc.Length;
// The buffer size is set to 8kb
int buffLength = 8192;
byte[] buff = new byte[buffLength];
int contentLen;
// Opens a file stream (System.IO.FileStream) to read the file to be uploaded
FileStream fs = fileInfSrc.OpenRead();
try
{
// Stream to which the file to be upload is written
Stream strm = reqFTP.GetRequestStream();
// Read from the file stream 2kb at a time
contentLen = fs.Read(buff, 0, buffLength);
// Till Stream content ends
while (contentLen != 0)
{
// Write Content from the file stream to the FTP Upload Stream
strm.Write(buff, 0, contentLen);
contentLen = fs.Read(buff, 0, buffLength);
}
// Close the file stream and the Request Stream
strm.Close();
fs.Close();
}
catch (Exception ex)
{
fs.Close();
return (ex.Message);
}
return "ok";
}
这是我的电话:
myFtp.Class1.strHost = "ftp://XXXXXXXXXXXXX";
myFtp.Class1.strPass = "*****************";
myFtp.Class1.strUser = "*********";
myFtp.Class1.nPort = 21;
myFtp.Class1.Upload_SSL(@"D:\Test.txt");
这是我的应用程序日志:
System.Net Information: 0 : [35744] FtpWebRequest#44624228::.ctor(ftp://XXXXXXXXXX/Test.txt)
System.Net Information: 0 : [35744] FtpWebRequest#44624228::GetRequestStream(Méthode=STOR.)
System.Net Information: 0 : [35744] Associating FtpWebRequest#44624228 with FtpControlStream#17654054
System.Net Information: 0 : [35744] FtpControlStream#17654054 - Réponse reçue [220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 50 allowed.
220-Local time is now 17:14. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.]
System.Net Information: 0 : [35744] FtpControlStream#17654054 - Envoi de la commande [AUTH TLS]
System.Net Information: 0 : [35744] FtpControlStream#17654054 - Réponse reçue [234 AUTH TLS OK.]
System.Net Information: 0 : [35744] TlsStream#52727599::.ctor(host=XXXXXX.shop, #certs=0)
System.Net Information: 0 : [35744] FtpControlStream#17654054 - Envoi de la commande [PBSZ 0]
System.Net Information: 0 : [35744] SecureChannel#14347911::.ctor(hostname=XXXXXX.shop, #clientCertificates=0)
System.Net Information: 0 : [35744] Énumération des packages de sécurité :
System.Net Information: 0 : [35744] Negotiate
System.Net Information: 0 : [35744] NegoExtender
System.Net Information: 0 : [35744] Kerberos
System.Net Information: 0 : [35744] NTLM
System.Net Information: 0 : [35744] Schannel
System.Net Information: 0 : [35744] Microsoft Unified Security Protocol Provider
System.Net Information: 0 : [35744] WDigest
System.Net Information: 0 : [35744] TSSSP
System.Net Information: 0 : [35744] pku2u
System.Net Information: 0 : [35744] CREDSSP
System.Net Information: 0 : [35744] SecureChannel#14347911 - Laissé avec un choix de 0 certificats clients.
System.Net Information: 0 : [35744] AcquireCredentialsHandle(package = Microsoft Unified Security Protocol Provider, intent = Outbound, scc = System.Net.SecureCredential)
System.Net Information: 0 : [35744] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = (null), targetName = XXXXXXXX, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)
System.Net Information: 0 : [35744] InitializeSecurityContext(longueur de In-Buffer=0, longueur de Out-Buffer=127, code retourné=ContinueNeeded).
System.Net Information: 0 : [35744] FtpWebRequest#44624228::(Libération de la connexion FTP n° 17654054.)
System.Net Information: 0 : [35744] Associating FtpWebRequest#44624228 with FtpControlStream#51393439
System.Net Information: 0 : [35744] FtpControlStream#51393439 - Réponse reçue [220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 50 allowed.
220-Local time is now 17:14. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.]
System.Net Information: 0 : [35744] FtpControlStream#51393439 - Envoi de la commande [AUTH TLS]
System.Net Information: 0 : [35744] FtpControlStream#51393439 - Réponse reçue [234 AUTH TLS OK.]
System.Net Information: 0 : [35744] TlsStream#26756241::.ctor(host=XXXXXXXXXXX, #certs=0)
System.Net Information: 0 : [35744] FtpControlStream#51393439 - Envoi de la commande [PBSZ 0]
System.Net Information: 0 : [35744] SecureChannel#23264094::.ctor(hostname=XXXXXXXXXXXX, #clientCertificates=0)
System.Net Information: 0 : [35744] SecureChannel#23264094 - Laissé avec un choix de 0 certificats clients.
System.Net Information: 0 : [35744] Utilisation du gestionnaire d'informations d'identification mises en cache.
System.Net Information: 0 : [35744] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = (null), targetName = XXXXXXXXXXX, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)
System.Net Information: 0 : [35744] InitializeSecurityContext(longueur de In-Buffer=0, longueur de Out-Buffer=127, code retourné=ContinueNeeded).
System.Net Information: 0 : [35744] FtpWebRequest#44624228::(Libération de la connexion FTP n° 51393439.)
System.Net Error: 0 : [35744] Exception in the FtpWebRequest#44624228::GetRequestStream - Le serveur distant a retourné une erreur : 234 AUTH TLS OK.
.
System.Net Error: 0 : [35744] à System.Net.FtpWebRequest.CheckError()
à System.Net.FtpWebRequest.SyncRequestCallback(Object obj)
à System.Net.CommandStream.Abort(Exception e)
à System.Net.FtpWebRequest.FinishRequestStage(RequestStage stage)
à System.Net.FtpWebRequest.GetRequestStream()
这是我的 FileZilla 日志:
Statut : Résolution de l'adresse de XXXXXXXXXXX
Statut : Connexion à XX.XX.XX.XX:21...
Statut : Connexion établie, attente du message d'accueil...
Suivi : CFtpControlSocket::OnReceive()
Réponse : 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Réponse : 220-You are user number 1 of 50 allowed.
Réponse : 220-Local time is now 17:18. Server port: 21.
Réponse : 220-This is a private system - No anonymous login
Réponse : 220-IPv6 connections are also welcome on this server.
Réponse : 220 You will be disconnected after 15 minutes of inactivity.
Suivi : CFtpControlSocket::SendNextCommand()
Commande : AUTH TLS
Suivi : CFtpControlSocket::OnReceive()
Réponse : 234 AUTH TLS OK.
Statut : Initialisation de TLS...
Suivi : CTlsSocket::Handshake()
Suivi : CTlsSocket::ContinueHandshake()
Suivi : TLS handshake: About to send CLIENT HELLO
Suivi : TLS handshake: Sent CLIENT HELLO
Suivi : CTlsSocket::OnSend()
Suivi : CTlsSocket::OnRead()
Suivi : CTlsSocket::ContinueHandshake()
Suivi : CTlsSocket::OnRead()
Suivi : CTlsSocket::ContinueHandshake()
Suivi : TLS handshake: Received SERVER HELLO
Suivi : TLS handshake: Processed SERVER HELLO
Suivi : CTlsSocket::OnRead()
Suivi : CTlsSocket::ContinueHandshake()
Suivi : TLS handshake: Received CERTIFICATE
Suivi : TLS handshake: Processed CERTIFICATE
Suivi : TLS handshake: Received SERVER HELLO DONE
Suivi : TLS handshake: Processed SERVER HELLO DONE
Suivi : TLS handshake: About to send CLIENT KEY EXCHANGE
Suivi : TLS handshake: Sent CLIENT KEY EXCHANGE
Suivi : TLS handshake: About to send FINISHED
Suivi : TLS handshake: Sent FINISHED
Suivi : CTlsSocket::OnRead()
Suivi : CTlsSocket::ContinueHandshake()
Suivi : TLS handshake: Received NEW SESSION TICKET
Suivi : TLS handshake: Processed NEW SESSION TICKET
Suivi : TLS handshake: Received FINISHED
Suivi : TLS handshake: Processed FINISHED
Suivi : TLS Handshake successful
Suivi : Protocol: TLS1.2, Key exchange: RSA, Cipher: AES-256-GCM, MAC: AEAD
Statut : Vérification du certificat...
Statut : Connexion TLS établie.
Suivi : CFtpControlSocket::SendNextCommand()
Commande : USER XXXXXXXXXXXXXXXX
Suivi : CTlsSocket::OnRead()
Suivi : CFtpControlSocket::OnReceive()
Réponse : 331 User XXXXXXXXXXXXXXXXXX OK. Password required
Suivi : CFtpControlSocket::SendNextCommand()
Commande : PASS ****************************
Suivi : CTlsSocket::OnRead()
Suivi : CFtpControlSocket::OnReceive()
Réponse : 230 OK. Current directory is /
Suivi : CFtpControlSocket::SendNextCommand()
Commande : OPTS UTF8 ON
Suivi : CTlsSocket::OnRead()
Suivi : CFtpControlSocket::OnReceive()
Réponse : 200 OK, UTF-8 enabled
Suivi : CFtpControlSocket::SendNextCommand()
Commande : PBSZ 0
Suivi : CTlsSocket::OnRead()
Suivi : CFtpControlSocket::OnReceive()
Réponse : 200 PBSZ=0
Suivi : CFtpControlSocket::SendNextCommand()
Commande : PROT P
Suivi : CTlsSocket::OnRead()
Suivi : CFtpControlSocket::OnReceive()
Réponse : 200 Data protection level set to "private"
Statut : Connecté
Suivi : CFtpControlSocket::ResetOperation(0)
Suivi : CControlSocket::ResetOperation(0)
Suivi : CFileZillaEnginePrivate::ResetOperation(0)
Suivi : Measured latency of 15 ms
Suivi : CFtpControlSocket::FileTransfer()
Statut : Démarrage de l'envoi de C:\Users\XXXXXX\Downloads\desktop.ini
Suivi : CFtpControlSocket::SendNextCommand()
Suivi : CFtpControlSocket::ChangeDirSend()
Commande : CWD /
Suivi : CTlsSocket::OnRead()
Suivi : CFtpControlSocket::OnReceive()
Réponse : 250 OK. Current directory is /
Suivi : CFtpControlSocket::ResetOperation(0)
Suivi : CControlSocket::ResetOperation(0)
Suivi : CFtpControlSocket::ParseSubcommandResult(0)
Suivi : FileTransferSubcommandResult()
Suivi : CFtpControlSocket::SendNextCommand()
Suivi : FileTransferSend()
Suivi : CFtpControlSocket::SendNextCommand()
Suivi : CFtpControlSocket::TransferSend()
Suivi : state = 1
Commande : TYPE I
Suivi : CTlsSocket::OnRead()
Suivi : CFtpControlSocket::OnReceive()
Réponse : 200 TYPE is now 8-bit binary
Suivi : CFtpControlSocket::TransferParseResponse()
Suivi : code = 2
Suivi : state = 1
Suivi : CFtpControlSocket::SendNextCommand()
Suivi : CFtpControlSocket::TransferSend()
Suivi : state = 2
Commande : PASV
Suivi : CTlsSocket::OnRead()
Suivi : CFtpControlSocket::OnReceive()
Réponse : 227 Entering Passive Mode (188,165,33,200,32,110)
Suivi : CFtpControlSocket::TransferParseResponse()
Suivi : code = 2
Suivi : state = 2
Suivi : CFtpControlSocket::SendNextCommand()
Suivi : CFtpControlSocket::TransferSend()
Suivi : state = 4
Suivi : Binding data connection source IP to control connection source IP 172.16.0.10
Commande : STOR desktop.ini
Suivi : CTransferSocket::OnConnect
Suivi : CTlsSocket::Handshake()
Suivi : Trying to resume existing TLS session.
Suivi : CTlsSocket::ContinueHandshake()
Suivi : TLS handshake: About to send CLIENT HELLO
Suivi : TLS handshake: Sent CLIENT HELLO
Suivi : CTlsSocket::OnSend()
Suivi : CTlsSocket::OnSend()
Suivi : CTlsSocket::OnRead()
Suivi : CTlsSocket::ContinueHandshake()
Suivi : CTlsSocket::OnRead()
Suivi : CFtpControlSocket::OnReceive()
Réponse : 150 Accepted data connection
Suivi : CFtpControlSocket::TransferParseResponse()
Suivi : code = 1
Suivi : state = 4
Suivi : CFtpControlSocket::SendNextCommand()
Suivi : CFtpControlSocket::TransferSend()
Suivi : state = 5
Suivi : CTlsSocket::OnRead()
Suivi : CTlsSocket::ContinueHandshake()
Suivi : TLS handshake: Received SERVER HELLO
Suivi : TLS handshake: Processed SERVER HELLO
Suivi : TLS handshake: Received FINISHED
Suivi : TLS handshake: Processed FINISHED
Suivi : TLS handshake: About to send FINISHED
Suivi : TLS handshake: Sent FINISHED
Suivi : TLS Handshake successful
Suivi : TLS Session resumed
Suivi : Protocol: TLS1.2, Key exchange: RSA, Cipher: AES-256-GCM, MAC: AEAD
Suivi : CTransferSocket::OnConnect
Suivi : CTlsSocket::Shutdown()
Suivi : CTransferSocket::TransferEnd(1)
Suivi : CFtpControlSocket::TransferEnd()
Suivi : CTlsSocket::OnRead()
Suivi : CFtpControlSocket::OnReceive()
Réponse : 226-File successfully transferred
Suivi : CTlsSocket::OnRead()
Suivi : CFtpControlSocket::OnReceive()
Réponse : 226 0.004 seconds (measured here), 67.83 Kbytes per second
Suivi : CFtpControlSocket::TransferParseResponse()
Suivi : code = 2
Suivi : state = 7
Suivi : CFtpControlSocket::ResetOperation(0)
Suivi : CControlSocket::ResetOperation(0)
Suivi : CFtpControlSocket::ParseSubcommandResult(0)
Suivi : FileTransferSubcommandResult()
Suivi : CFtpControlSocket::ResetOperation(0)
Suivi : CControlSocket::ResetOperation(0)
Statut : Transfert de fichier réussi, 282 octets transférés en 1 seconde
Suivi : CFileZillaEnginePrivate::ResetOperation(0)
Statut : Récupération du contenu du dossier "/"...
Suivi : CFtpControlSocket::ParseSubcommandResult(0)
Suivi : CFtpControlSocket::ListSubcommandResult()
Suivi : state = 1
Suivi : CFtpControlSocket::SendNextCommand()
Suivi : CFtpControlSocket::TransferSend()
Suivi : state = 2
Commande : PASV
Suivi : CTlsSocket::OnRead()
Suivi : CFtpControlSocket::OnReceive()
Réponse : 227 Entering Passive Mode (188,165,33,200,128,109)
Suivi : CFtpControlSocket::TransferParseResponse()
Suivi : code = 2
Suivi : state = 2
Suivi : CFtpControlSocket::SendNextCommand()
Suivi : CFtpControlSocket::TransferSend()
Suivi : state = 4
Suivi : Binding data connection source IP to control connection source IP 172.16.0.10
Commande : MLSD
Suivi : CTransferSocket::OnConnect
Suivi : CTlsSocket::Handshake()
Suivi : Trying to resume existing TLS session.
Suivi : CTlsSocket::ContinueHandshake()
Suivi : TLS handshake: About to send CLIENT HELLO
Suivi : TLS handshake: Sent CLIENT HELLO
Suivi : CTlsSocket::OnSend()
Suivi : CTlsSocket::OnSend()
Suivi : CTlsSocket::OnRead()
Suivi : CTlsSocket::ContinueHandshake()
Suivi : CTlsSocket::OnRead()
Suivi : CFtpControlSocket::OnReceive()
Réponse : 150 Accepted data connection
Suivi : CFtpControlSocket::TransferParseResponse()
Suivi : code = 1
Suivi : state = 4
Suivi : CFtpControlSocket::SendNextCommand()
Suivi : CFtpControlSocket::TransferSend()
Suivi : state = 5
Suivi : CTlsSocket::OnRead()
Suivi : CTlsSocket::ContinueHandshake()
Suivi : TLS handshake: Received SERVER HELLO
Suivi : TLS handshake: Processed SERVER HELLO
Suivi : TLS handshake: Received FINISHED
Suivi : TLS handshake: Processed FINISHED
Suivi : TLS handshake: About to send FINISHED
Suivi : TLS handshake: Sent FINISHED
Suivi : TLS Handshake successful
Suivi : TLS Session resumed
Suivi : Protocol: TLS1.2, Key exchange: RSA, Cipher: AES-256-GCM, MAC: AEAD
Suivi : CTransferSocket::OnConnect
Suivi : CTlsSocket::OnRead()
Suivi : CFtpControlSocket::OnReceive()
Réponse : 226-Options: -a -l
Réponse : 226 4 matches total
Suivi : CFtpControlSocket::TransferParseResponse()
Suivi : code = 2
Suivi : state = 5
Suivi : CFtpControlSocket::SendNextCommand()
Suivi : CFtpControlSocket::TransferSend()
Suivi : state = 8
Suivi : CTlsSocket::OnRead()
Suivi : CTransferSocket::OnReceive(), m_transferMode=0
Suivi : CTransferSocket::TransferEnd(1)
Suivi : CFtpControlSocket::TransferEnd()
Suivi : CFtpControlSocket::ResetOperation(0)
Suivi : CControlSocket::ResetOperation(0)
Suivi : CFtpControlSocket::ParseSubcommandResult(0)
Suivi : CFtpControlSocket::ListSubcommandResult()
Suivi : state = 3
Suivi : CFtpControlSocket::ResetOperation(0)
Suivi : CControlSocket::ResetOperation(0)
Statut : Contenu du dossier "/" affiché avec succès
Suivi : CFileZillaEnginePrivate::ResetOperation(0)
有人有什么想法吗?
编辑:这是服务器上的日志:
Nov 29 10:12:09 ns309686 pure-ftpd: (?@LNeuilly-656-1-52-66.w80-11.abo.wanadoo.fr) [INFO] New connection from LNeuilly-656-1-52-66.w80-11.abo.wanadoo.fr
Nov 29 10:12:09 ns309686 pure-ftpd: (?@LNeuilly-656-1-52-66.w80-11.abo.wanadoo.fr) [WARNING] Sorry, cleartext sessions are not accepted on this server.#012Please reconnect using SSL/TLS secu$
Nov 29 10:12:10 ns309686 pure-ftpd: (?@LNeuilly-656-1-52-66.w80-11.abo.wanadoo.fr) [INFO] New connection from LNeuilly-656-1-52-66.w80-11.abo.wanadoo.fr
Nov 29 10:12:10 ns309686 pure-ftpd: (?@LNeuilly-656-1-52-66.w80-11.abo.wanadoo.fr) [WARNING] Sorry, cleartext sessions are not accepted on this server.#012Please reconnect using SSL/TLS secu$
---> 似乎 TLS 未启用,但为什么?
非常感谢:)
最佳答案
我相信您的服务器需要 TLS 1.2。而且您使用的是 .NET 3.5,它不支持 TLS 1.2。
尝试切换到 .NET 4.5.2 或更新版本。
参见 https://learn.microsoft.com/en-us/dotnet/api/system.security.authentication.sslprotocols
关于c# - 在 TLS : The remote server return an error : 234 AUTH TLS OK 上使用 FtpWebRequest 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40849090/
询问 unrelated question我有这样的代码: public boolean equals(Object obj) { if (this == obj) retur
在我之前的一个问题中 js: Multiple return in Ternary Operator我询问了有关使用三元运算符返回多个参数的问题。但是现在参数IsActveUser boolean(t
假设我有一个带有 return 的 if 语句。从效率的角度来看,我应该使用 if(A > B): return A+1 return A-1 或 if(A > B): return
例如考虑以下代码: int main(int argc,char *argv[]) { int *p,*q; p = (int *)malloc(sizeof(int)*10); q
PyCharm 对这段代码发出警告,说最后一个返回是不可访问的: def foo(): with open(...): return 1 return 0 如果 ope
我想实现这样的目标: 如果在返回 Json 的方法中抛出异常,则返回 new Json(new { success = false, error = "unknown"}); 但如果方法返回 View
它是多余的,但我正在学习 JS,我想知道它是如何工作的。 直接从模块返回函数 let func1 = function () { let test = function () {
我不明白我应该使用什么。我有两页 - intro.jsp(1) 和 booksList.jsp(2)。我为每一页创建了一个 Controller 类。第一页有打开第二页的按钮:
我最近在 Joomla 组件(Kunena,更准确地说是 Kunena)中看到这段代码,那么使用 $this->return VS 简单的 return 语句有什么区别. 我已经用谷歌搜索了代码,但没
我的类实现了 IEnumerable。并且可以编译这两种方式来编写 GetEnumerator 方法: public IEnumerator GetEnumerator() { yield r
我只是在编码,我想到了一个简单的想法(显然是问题),如果我有一个像这样的函数: int fun1(int p){ return(p); } 我有一个这样的函数: int fun1(int p){
这个问题在这里已经有了答案: What does the comma operator do in JavaScript? (5 个答案) 关闭 9 年前。 function makeArray
假设我写了一个 for 循环,它将输出所有数字 1 到 x: x=4 for number in xrange(1,x+1): print number, #Output: 1 2 3 4 现
我最近在这个 Apache Axis tutorial example. 中看到了下面的一段代码 int main() { int status = AXIS2_SUCCESS; ax
function a(){ return{ bb:"a" } } and function a(){ return { bb:"a" } } 这两个代码有什么区别吗,如果有请
function a() { return 1; } function b() { return(1); } 我在 Chrome 的控制台中测试了上面的代码,都返回了 1。 function c()
考虑这三个函数: def my_func1(): print "Hello World" return None def my_func2(): print "Hello World"
这可能是一个愚蠢的问题,但我正在努力,如果有一种简明的方法来测试函数的返回结果,如果它不满足条件,则返回该值(即,传递它)。。现在来回答一个可能的问题,是的,我正在寻找的类似于例外提供的东西。然而,作
我正在测试一个函数,并尝试使用 return 来做什么,并在 PowerShell 5.1 和 PwSh 7.1 中偶然发现了一个奇怪的问题,即 return cmdlet似乎不适合在团体中工作: P
这个问题已经有答案了: Return in generator together with yield (2 个回答) Why can't I use yield with return? (5 个回
我是一名优秀的程序员,十分优秀!