??? TLS ?? ??
TLS? ?? ???? ?????? ??? ? ????? ?? ???? ??? ?? TLS ??? ???? ?? ??? ??? ????. ? ????? ??? ????? ?? ? ??? ???? ??? ?????.
.NET Reflection API ??
Framework 4.7 ???? ???? .NET ??????? ?? ?? ??? ????? ???? ?? TlsStream? ????? ??? TLS ????? ?????.
using System.Net; using System.Reflection; using System.Security.Authentication; // 獲取與網(wǎng)絡(luò)請(qǐng)求關(guān)聯(lián)的TLS流 using (var requestStream = request.GetRequestStream()) { // 利用反射訪問(wèn)TLS流的屬性 var tlsStream = requestStream.GetType() .GetProperty("Connection", BindingFlags.Instance | BindingFlags.NonPublic) .GetValue(requestStream); var tlsState = tlsStream.GetType() .GetProperty("NetworkStream", BindingFlags.Instance | BindingFlags.NonPublic) .GetValue(tlsStream); var sslProtocol = (SslProtocols)tlsState.GetType() .GetProperty("SslProtocol", BindingFlags.Instance | BindingFlags.NonPublic) .GetValue(tlsState); // 處理協(xié)商的TLS協(xié)議(例如,日志記錄或顯示) }
?? ??? ?? ?? ??
? ?? ?? ??? TLS ??? ??? ? ???? ServerCertificateValidationCallback? ???? ????. ? ??? ???? ??? ??? ????.
using System.Net; using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; // 設(shè)置ServerCertificateValidationCallback ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, errors) => { // 獲取TLS協(xié)議版本 var sslProtocol = ((SslStream)sender).SslProtocol; // 處理協(xié)商的TLS協(xié)議(例如,日志記錄或顯示) return true; // 回調(diào)也可以用于證書(shū)驗(yàn)證,此處作為一個(gè)示例顯示。 };
.NET ?? DLL ??
????? ?? ???? ??? ????? ?? secur32.dll? QueryContextAttributesW ???? ???? ?? ??? ????. ? ??? ???? ??? ?? ??? ?? ??? ??? ??? ? ????.
using System; using System.Runtime.InteropServices; [DllImport("secur32.dll", CharSet = CharSet.Auto, ExactSpelling = true, SetLastError = false)] private static extern int QueryContextAttributesW( IntPtr contextHandle, ContextAttribute attribute, ref SecPkgContext_ConnectionInfo connectionInfo); public enum ContextAttribute { // 獲取TLS協(xié)議版本 SecPkgContext_ConnectionInfo = 0x9 } public struct SecPkgContext_ConnectionInfo { public SchProtocols dwProtocol; // 其他屬性也可以用于獲取有關(guān)密碼和哈希算法的信息 }
??: ? ??? ????? ??? ?? ? ??? ????? ??? ? ???? ?????.
??? ??? ?????? ???? HttpWebRequest ? TcpClient ??? ?? ??? TLS ??? ???? ??? ? ??? ?? ??? ??? ??? ? ????.
? ??? .NET ???????? ??? TLS ??? ???? ??? ??????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











?, ?? ???? C? ??? ??, ?? ??? ? ??????. 1. ?? ???? ??? ??? ?? ?? ??? ?? ?? ??? ?????. 2. ????? ??? ?? ??? ?? ??? ??? ?? ? ??? ?????. 3. ??? ???? ?? ?? ???? ???? ?? ?? ??? ??? ????? ????? ???? ?????.

C? ? ?? ?? ??? ??? ??? : ??? ?? ??? ? ??? ???. 1. ??? ?? ???? ?? ??? ? ???? ?? ????? ?? ??? ????? ?? ???? ??? ? ????. 2. ??? ???? ?? ?? ? ??? ?? ???? ???? ??? ?? ?? ??? ?????.

?, C? ???? ?? ?????. 1) ??? ??? ?? ?? ? ??? ???? ?????. 2) ?? ???? ???? ??? ????. 3) ?? ??? ????? ??? ?? ???? ??? ??? ? ??????. ?? ? ??? ?? ???? ???? ??? ?????? ??? ?? ?????.

C DestructorsCanleadToSeVeralCommonerrors.toaVoidthem : 1) ?? ?? ?? ?? ?? ?? ???

?? ???? ??? C?? ??? ??? ???? ??? : ? ????? ? ? ????? C? ??? ? ????? ?? ?? ??? ?? ??? ???? ?????. 1. ?? ??? ???? C? ?? ??? ???? ?? ?? ?? Curly Braces {}? ???? ?? ??? ?? ??? ???????. 2. ?? ??? ? ??? ?? ???? C?? ?? ??? ?? ????? ??? ???? ???? ???? ??? ?????? ???????. RAII ??? ?? ??? ??? ? ????. 3. ?? ? ??? ???? C? ?? ?, ??? ? ???? ?? ??? ??????? ??? ???? ?? ?? ??? ???????. 4. ?? ????? ???? STL? ??? ????? ????? ????? ???? ????? ????? ???????. 5

C? ???? ??? ??? ? ??? ?? ????? ????. 1. ??? ???? ?? ??? ?? ????? ???? ??? ??? ???? ?? ? ? ????. 2. ??? ?? ???? ?? ??? ? ???? ?? ????, ??? ???? ?????.

C polymorphismincludescompile time, ??? ? Templatepolymorphism.1) compile-timepolymorphismusesfunctionandoveroveroverforlogy

C DestructorseSpecialmembections? ScopeorisDeleted?? whoenanobjectgoesout.1) theaUcialmanagingMemory, FileHandles ? NetworkConnection.2) ??? wengrectdefiningdestructorsfordynamicmemory, LeadingTomemo
