草庐IT

airbrake_request_data

全部标签

c# - 具有多个值的 System.Data.SQLite 参数化查询?

我正在尝试使用参数化查询运行批量删除。目前,我有以下代码:pendingDeletions=newSQLiteCommand(@"DELETEFROM[centres]WHERE[name]=$name",conn);foreach(stringnameinselected)pendingDeletions.Parameters.AddWithValue("$name",name);pendingDeletions.ExecuteNonQuery();但是,参数的值似乎每次都被覆盖,我最终只删除了最后一个中心。使用值列表执行参数化查询的正确方法是什么? 最佳

c# - 当我使用 System.Data.SqlClient 版本 4.4.3 时,无法加载文件或程序集 System.Data.SqlClient,版本 = 4.2.0.2

我对我的ASP.NETCore2.0项目中的所有.NETStandard2.0类库使用System.Data.SqlClient版本4.4.3。为什么我得到Couldnotloadfileorassembly'System.Data.SqlClient,Version=4.2.0.2,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a'.Thelocatedassembly'smanifestdefinitiondoesnotmatchtheassemblyreference.(ExceptionfromHRESULT:0x80131040)

c# - 安全异常 : Request for the permission of type 'System.Net.Mail.SmtpPermission'

这是“在本地工作,在服务器上不工作”的帖子之一。我有一个发送电子邮件的简单联系表单。在服务器上,我得到以下异常:SecurityExceptionDescription:Theapplicationattemptedtoperformanoperationnotallowedbythesecuritypolicy.Tograntthisapplicationtherequiredpermissionpleasecontactyoursystemadministratororchangetheapplication'strustlevelintheconfigurationfile.Ex

c# - 使用 WebClient 和 C#,即使响应为 (400) Bad Request,我如何获取返回的数据?

我正在使用GoogleTranslateAPI并trycatch当我收到error时返回的数据.(仅供引用:我知道APIkey是错误的,我只是在测试它)。问题是浏览器,您可以通过单击链接看到,显示错误信息,但C#抛出WebException,我似乎无法获得响应数据。这是我的代码:stringurl="https://www.googleapis.com/language/translate/v2?key=INSERT-YOUR-KEY&source=en&target=de&q=Hello%20world";WebClientclnt=newWebClient();//Getstrin

c# - System.Web.Http.ApiController.get_Request() 中缺少方法

我有一个Controller。publicsealedclassAccountsController:BaseApiController{privatereadonlyIDatabaseAdapter_databaseAdapter;publicAccountsController(IDatabaseAdapterdatabaseAdapter){_databaseAdapter=databaseAdapter;}[AllowAnonymous][Route("create")]publicasyncTaskCreateUser(CreateUserBindingModelcreate

c# - fiddler /C# : search content of request/response for special phrases

这是我第一次访问stackoverflow,现在我对这个网站感到非常满意。它已经帮助我获得了FiddlerCore嵌入到MSVisualC#2008ExpressEdition中。只需要在MSVisualC#EE中从项目资源管理器(Projektmappenexplorer)创建对fiddlercoredll的引用(Verweis)。希望这是它在英文版中的名称。在此之后,您可以使用Fiddler.FiddlerApplication等。我的任务是什么?我想创建一个小程序,它能够使用FiddlerCore检查特殊JavaScript代码的请求/响应主体。这使开发人员能够检查他们的代码在其

c# - MVC 5 中的 System.Data.Entity.Core.ProviderIncompatible 异常

我正在mvc5中创建一个ASP.NETWeb应用程序,我制作了一个带有Controller的模型类。我的应用程序正在运行,但是当我想在像localhost:1234/Movies这样的url中访问我的电影Controller时,它会在我的MoviesController.cs文件中生成异常我使用的连接字符串是产生这个异常的函数是publicActionResultIndex(){returnView(db.Movies.ToList());}编辑异常详细信息“System.Data.Entity.Core.ProviderIncompatibleException”类型的异常发生在En

c# - Request.Url.Query 和 Request.QueryString 有什么区别?

我一直在追踪一个关于UrlRewriting应用程序的错误。该错误表现为查询字符串中某些变音符号的编码问题。基本上,问题是基本上是/search.aspx?search=heřmánek的请求被重写为“search=he%c5%99m%c3%a1nek”的查询字符串正确的值(使用一些不同的工作代码)是将查询字符串重写为“search=he%u0159m%u00e1nek”注意两个字符串之间的区别。但是,如果您将两者都发布,您将看到Url编码重现相同的字符串。直到您使用context.Rewrite函数,编码才会中断。损坏的字符串返回“heÅmánek”(使用Request.QueryS

c# - 调用 HttpContext.Request 时如何避免 HttpException?

所以HttpContext.Request如果在全局启动内调用则抛出publicHttpRequestget_Request(){if(this.HideRequestResponse){thrownewHttpException(SR.GetString("Request_not_available"));}returnthis._request;}这实际上是有记录的ASP.NETwillthrowanexceptionifyoutrytousethispropertywhentheHttpRequestobjectisnotavailable.Forexample,thiswoul

c# - MVVM : Share data between ViewModels

如何在多个ViewModel之间共享数据?例如,应用程序中有一个名为Project的类。publicclassProject:ModelBase{privatestring_projectName;publicstringProjectName{get{return_projectName;}set{_projectName=value;RaisePropertyChanged(()=>ProjectName);}}}在多个ViewModels应用程序中应该访问ActiveProject。在ViewModel之间共享项目的最佳方式是什么?中介者模式?(消息)静态对象单例模式(如果是怎么