草庐IT

SECURE_CONNECTION

全部标签

c# - SignalR 2.1.0 : The connection has not been established

我有一个ASP.NETWeb应用程序,其中包含一个简单的HTML页面和一些通过SignalR进行通信的JavaScript。那很好用。现在,我正在尝试从另一个项目(在同一解决方案中)调用Hub上的方法并使用.NETSignalrClientApi:varconnection=newHubConnection("http://localhost:32986/");varhub=connection.CreateHubProxy("MessageHub");connection.Start();hub.Invoke("SendMessage","","");最后一行导致InvalidOpe

c# - 请求被中止 : Could not create SSL/TLS secure channel

这个问题在这里已经有了答案:关闭10年前。PossibleDuplicate:Therequestwasaborted:CouldnotcreateSSL/TLSsecurechannel我正在尝试发送带有客户端证书的http请求。该文件,在本例中为.p12文件。但是,当它到达responseStream=httpRequest.GetRequestStream();行时,它抛出WebException:System.Net.WebException:Therequestwasaborted:CouldnotcreateSSL/TLSsecurechannel.我在IIS7.5(在Wi

c# - 执行非查询 : Connection property has not been initialized.

下午,所以我已经在这个问题上研究了几个小时,但无法真正克服最后一个障碍。下面是我正在编写的这个程序的代码:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Diagnostics;usingSystem.Data;usingSystem.Data.SqlClient;usingSystem.Configuration;namespaceTest{classProgram{staticvoidMain(){EventLogalog=newEventLog();

c# - Connection.open 无限期挂起,不抛出异常

当我尝试执行以下代码时,程序无限期挂起。我不知道为什么,似乎还有其他Unresolved话题。不过,如果无法访问IP\网站,则它会按预期工作。privatevoidDoStuff(){stringconnectionString="DataSource=www.google.com;ConnectionTimeout=5";using(SqlConnectionconnection=newSqlConnection(connectionString)){connection.Open();//HangshereindefinitelyConsole.WriteLine("Test");

c# - 自动更新 : Is this secure?

DotNetAutoUpdate我觉得.net缺少一个简单的安全自动更新库,所以我实现了一些东西并将其发布here.在任何人考虑使用该库之前,我都热衷于更新过程以获得同行评审。步骤如下:客户端软件填充有公钥和URI以进行轮询。客户端轮询list文件的URI。下载list并使用签名(在单独的“.signature”中)检查list是否有效。从list中解析出待定更新列表(以显示给用户)。安装程序文件已下载并再次使用相应的“.signature”文件进行验证。(下载的文件将受ACL保护)安装程序已运行。减轻威胁:list签名应防止任何恶意下载(“carpetbombing”)安装程序签名应

c# - httpWebRequest(底层连接已关闭 : The connection was closed unexpectedly. )

我正在开发一个C#应用程序,它记录来自网络服务器的数据。它向网络服务器发送以下发布请求并等待响应。//////FunctionforobtainingtestCgidata/////////privatestringHttpmyPost(stringParameters){stringstr="Noresponse";HttpWebRequestrequest=(HttpWebRequest)WebRequest.Create(uriTestCGI);request.Method="POST";byte[]bytes=Encoding.UTF8.GetBytes(Parameters)

c# - Web Config.Connection String 中的相对路径引用

是否可以在web.config中的连接字符串、attachDbFileName属性中指定相对路径引用?例如,在我的数据库位于App_data文件夹中,我可以轻松地将AttachDBFilename指定为|DataDirectory|\mydb.mdf和|Datadirectory|将自动解析为正确的路径。现在,假设web.config文件位于A文件夹中,但数据库位于B\App_data文件夹中,其中A和B文件夹位于同一文件夹中。无论如何使用相对路径引用来解析正确的路径? 最佳答案 我在以下场景中遇到了同样的问题:我想使用与集成测试中

C# 系统.Net.WebException : The underlying connection was closed: An unexpected error occurred on a send

我在一台运行WindowsServer2003的服务器上遇到此错误:System.Net.WebException:Theunderlyingconnectionwasclosed:Anunexpectederroroccurredonasend.这是我的代码...有什么想法吗?HttpWebRequestrequest=(HttpWebRequest)WebRequest.Create("https://URLHERE");//request.Headers.Add("Accept","application/xml");byte[]bytes;bytes=System.Text.E

c# - 使用带有 connection.open 的语句

我正在查看一些代码并与同事讨论。特别是一段看起来像这样的代码。[Test]publicvoidTestNormalWay(){using(varcn=GetConnection()){cn.Open();//dostuff}}问题来了:"whynotmovethecn.OpenintotheGetConnectionmethod."我说过,如果“打开”抛出异常,则不会调用处置。他的回答是"Sowhat.Theconnectionwasn'topenedsowhywoulditneedtogetclosed(ordisposed)?"对我来说,这只是我不想知道是否需要处理/关闭的问题,所

c# - 系统.ServiceModel.CommunicationException : The underlying connection was closed

我正在从一个wcf网络服务中检索数据,当数据超过20万条记录时,我得到一个异常,如下所示:System.ServiceModel.CommunicationException:Theunderlyingconnectionwasclosed:Aconnectionthatwasexpectedtobekeptalivewasclosedbytheserver.--->System.Net.WebException:Theunderlyingconnectionwasclosed:Aconnectionthatwasexpectedtobekeptalivewasclosedbythes