草庐IT

Non-Local

全部标签

c# - 错误 : "an object reference is required for the non-static field, method or property..."

这个问题在这里已经有了答案:CS0120:Anobjectreferenceisrequiredforthenonstaticfield,method,orproperty'foo'(9个回答)关闭5年前。我正在用C#创建一个应用程序。它的功能是评估给定的是否为素数以及相同的交换数是否也是素数。当我在VisualStudio中构建我的解决方案时,它说“非静态字段、方法或属性需要对象引用...”。我在使用“volteado”和“siprimo”方法时遇到了这个问题。问题出在哪里,我该如何解决?namespaceConsoleApplication1{classProgram{static

C# 错误 : "An object reference is required for the non-static field, method, or property"

我有两个类,一个用于定义算法参数,另一个用于实现算法:1类(算法参数):usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceVM_Placement{publicstaticclassAlgorithmParameters{publicstaticintpop_size=100;publicstaticdoublecrossover_rate=0.7;publicstaticdoublemutation_rate=0.001;publicstaticintchrom

c# - MVC : The parameters dictionary contains a null entry for parameter 'k' of non-nullable type 'System.Int32'

我是MVC的新手。在我的应用程序中,我正在从Mydatabase中检索数据。但是当我运行我的应用程序时,它会显示这样的错误这是我的网址http://localhost:7317/Employee/DetailsData/4ExceptionDetails:System.ArgumentException:Theparametersdictionarycontainsanullentryforparameter'k'ofnon-nullabletype'System.Int32'formethod'System.Web.Mvc.ActionResultDetailsData(Int32)

c# - SQL 网络接口(interface),错误 : 50 - Local Database Runtime error occurred. 无法创建自动实例

我正在尝试构建一个ASP.NETMVC5Web应用程序,它在App_Data文件夹中有一个MyDatabase.mdf文件。我安装了带有LocalDb实例的SQLServer2014Express。我可以使用服务器资源管理器编辑数据库表,但是当我调试应用程序并转到需要数据库的页面时,出现以下错误。Anetwork-relatedorinstance-specificerroroccurredwhileestablishingaconnectiontoSQLServer.Theserverwasnotfoundorwasnotaccessible.Verifythattheinstanc

c# - 为什么我会收到消息 "Invalid setup on a non-virtual (overridable in VB) member..."的异常?

我有一个单元测试,我必须模拟一个返回bool类型的非虚拟方法publicclassXmlCupboardAccess{publicboolIsDataEntityInXmlCupboard(stringdataId,outstringnameInCupboard,outstringrefTypeInCupboard,stringnameTemplate=null){returnIsDataEntityInXmlCupboard(_theDb,dataId,outnameInCupboard,outrefTypeInCupboard,nameTemplate);}}所以我有一个XmlCu

javascript - window.localStorage 与 chrome.storage.local

我正在开发一个Chrome扩展程序,我需要存储一些数据,然后在某个时间点获取它。我对可用存储进行了调查,发现了以下内容:window.localStorage和chrome.storage.local。所以我的问题是,在Chrome扩展中使用哪个是正确的选择:window.localStorage还是chrome.storage.local?P.S.我正在使用浏览器操作在IFRAME中加载本地HTML。所以我没有使用popup.js。 最佳答案 本地存储优点:同步,因此更易于使用:varvalue=localStorage[key]

javascript - 错误 : [$compile:nonassign] Expression 'undefined' used with directive 'myFacebook' is non-assignable

我正在用angularjs编写一个指令并得到上面提到的错误。我正在使用一本书中的代码。.directive('myFacebook',[function(){return{link:function(scope,element,attributes){(function(d){varjs,id='facebook-jssdk',ref=d.getElementsByTagName('script')[0];if(d.getElementById(id)){return;}js=d.createElement('script');js.id=id;js.async=true;js.src

javascript - chrome.storage.local.get 和设置

这个问题在这里已经有了答案:WhyismyvariableunalteredafterImodifyitinsideofafunction?-Asynchronouscodereference(7个答案)关闭5年前。我正在尝试在我的扩展程序中使用chrome.storage.local,但它似乎不起作用。我使用了localStorage但意识到我不能在多个页面的内容脚本中使用它。所以,这就是我想出的:functionsave(){varchannels=$("#channels").val();varkeywords=$("#keywords").val();chrome.storag

mysql - 在 Docker 中安装 MySQL 失败并显示错误消息 "Can' t connect to local MySQL server through socket"

我正在尝试在docker容器中安装mysql,尝试了来自github的各种图像,似乎它们都成功安装了mysql,但是当我尝试运行mysql时出现错误:ERROR2002(HY000):Can'tconnecttolocalMySQLserverthroughsocket'/var/run/mysqld/mysqld.sock'系统规范:Ubuntu12,04在AWS上Docker0.10.0到目前为止我尝试过的包:https://github.com/eugeneware/docker-wordpress-nginxhttps://github.com/tutumcloud/tutum

mysql - 在 Docker 中安装 MySQL 失败并显示错误消息 "Can' t connect to local MySQL server through socket"

我正在尝试在docker容器中安装mysql,尝试了来自github的各种图像,似乎它们都成功安装了mysql,但是当我尝试运行mysql时出现错误:ERROR2002(HY000):Can'tconnecttolocalMySQLserverthroughsocket'/var/run/mysqld/mysqld.sock'系统规范:Ubuntu12,04在AWS上Docker0.10.0到目前为止我尝试过的包:https://github.com/eugeneware/docker-wordpress-nginxhttps://github.com/tutumcloud/tutum