我正在开发一个项目,我需要在c#中创建受密码保护的zip文件内容.
在我使用System.IO.Compression.GZipStream创建gzip内容之前..net是否具有create zip或rar密码保护文件的任何功能?
我正在使用C#.net核心从发送多个文件的多部分发布用户读取上传数据.如何在读取上一个文件后阻止使用等待无限
try
{
var cancellationTokenSource = new CancellationTokenSource();
cancellationTokenSource.CancelAfter(1000);
section = await multipartReader.ReadNextSectionAsync(cancellationTokenSource.Token);
}
catch (Exception ex)
{
throw;
}
Run Code Online (Sandbox Code Playgroud)
尽管我已经将cancelationToken设置为1秒但它会变为无限,如果我发送另一个请求,它将不会转到下一行.
public static async Task<HttpRequest> FromHttpContextAsync(HttpContext httpContext)
{
bool multipart = false;
HttpRequest retVal = new HttpRequest(httpContext);
var sb = new StringBuilder();
var sr = new StreamReader(httpContext.Stream, Encoding.UTF8);
{
var line1 = await sr.ReadLineAsync();
sb.AppendLine(line1);
var Line1Parts = (line1).Split(' ');
retVal.Methode = Line1Parts[0].ToLower();
retVal.RawUrl = System.Net.WebUtility.UrlDecode(Line1Parts[1]).Replace("&", "&");
var urlPart = retVal.RawUrl.Split('?');
retVal.Url = urlPart[0];
if (urlPart.Length > 1)
{
foreach …Run Code Online (Sandbox Code Playgroud) 我已经下载了 Python 3.7.3 源代码,并希望使用 openssl 支持来制作和安装它。
从 ./configure --help 发现新选项 --with-openssl 应该指向安装了 openssl-devel 的文件夹。
我已经为我的 Centos 安装了 openssl-devel.x86_64 之前和 make 命令时ls /usr/include/openssl |grep ssl,我找到了 ssl.h 但是当传递参数给 ./configure --with-openssl=/usr/include/openssl/or 时 ./configure --with-openssl=/usr/include/openssl,
它说检查openssl/ssl.h in /usr/include/openssl/... no
我想创建多个内存中的 sqlite 数据库,并用 python 命名。
在 sqlite 命令行中,可以使用以下语法来做到这一点:
':memory:' AS database_name
Run Code Online (Sandbox Code Playgroud)
但是当在 python 连接字符串中使用它时,如下所示:
con = sqlite3.connect("':memory:' AS database_name")
Run Code Online (Sandbox Code Playgroud)
得到错误。
我的问题是我们如何在内存数据库中创建多个具有访问它们的名称。
我们如何在 python 中做到这一点?
我用 C# 编写了自己的网络服务器。
我总是在端口 443 上的新 IP 中为我的网站建立 SSL 证书。并且始终工作正常。
但这一次我得到了这个错误:
安全连接失败
连接 www.sayehrooshan-co.com 时发生错误。SSL 收到的记录超出了最大允许长度。错误代码:
SSL_ERROR_RX_RECORD_TOO_LONG
由于无法验证接收到的数据的真实性,因此无法显示您尝试查看的页面。请联系网站所有者以告知他们此问题。
这是页面地址:
https://www.sayehrooshan-co.com
这是我的代码始终与其他站点的 .pfx 文件一起使用:
sslstream = new SslStream(new NetworkStream(mySocket, false), false);
//commented for nedaye arzhang
X509Certificate2 serverCertificate = new X509Certificate2(Path, Password);
//X509Certificate2 serverCertificate = new X509Certificate2("www_nedaye-arzhang_com.cer");
sslstream.AuthenticateAsServer(serverCertificate, false, System.Security.Authentication.SslProtocols.Tls, true);
Run Code Online (Sandbox Code Playgroud)
搜索了很多但没有得到任何解决方案有人知道吗?
c# ×3
.net ×1
async-await ×1
compilation ×1
multipart ×1
openssl ×1
passwords ×1
python ×1
python-3.x ×1
settimeout ×1
sqlite ×1
ssl ×1
zip ×1