草庐IT

accesses

全部标签

c# - 一个简单的 C# DLL - 如何从 Excel、Access、VBA、VB6 调用它?

我有一个用C#编写的简单类库。usingSystem;namespaceTestDll{publicclassTest{publicstringHelloWorld{get{return"HelloWorld";}}}}我的问题是如何从MicrosoftOfficeVisualBasic(我认为是VB6)调用这个HelloWorld函数?我的第一步是添加DLL作为引用-但在浏览和选择已编译的DLL时显示消息“无法添加对指定文件的引用。”被抛出。谁能为我指出正确的方向,说明为什么/如何让它发挥作用?提前致谢! 最佳答案 您不能通过CO

c# - 获取 "Tuple element name is inferred. Please use language version 7.1 or greater to access an element by its inferred name."

直到今天,在我们将VisualStudio2017更新到最新的15.3之后,我们的UWP应用程序中的以下代码一直运行良好。privatevoidTest(){vargroups=newListitems)>();varitems=newList{("a",true),("b",false),("c",false)};vargroup=(Guid.NewGuid(),items);groups.Add(group);}在输出窗口中没有错误信息但是这个Tupleelementname'items'isinferred.Pleaseuselanguageversion7.1orgreater

c# - C# : "an expression tree may not contain a base access" - why not? 错误

我正在调用一个接受Expression>的方法.作为我传递的表达式的一部分:this.Bottom==base.lineView.Top编译器给我一个错误anexpressiontreemaynotcontainabaseaccess所以我干脆改成了this.Bottom==this.lineView.Top因为该成员无论如何都受到了保护,现在可以使用了。但是这个错误真的让我很困惑:为什么这个base有问题吗?特别是如果使用this相反会工作但语法上是相同的结果(访问相同的变量)? 最佳答案 查看System.Linq.Expres

c# - ASP.net 在尝试将文件上传到我的 Windows Server 2008 R2 Web 服务器时出现错误 "Access to the path is denied."

我有一个asp.netweb应用程序,可以将文件上传到Web服务器上的特定文件夹。在本地一切正常,但是当我将应用程序部署到Web服务器时,我开始收到错误消息“访问路径“D:\Attachments\myfile.doc”被拒绝”。我给“IISAppPool”用户该应用程序在该文件夹的完全权限下运行。我什至给了“Everyone”完全权限,但出现了同样的错误。我将该文件夹添加到防病毒软件的异常(exception)列表中,但结果相同。我开始怀疑WindowsServer2008R2可能需要一些技巧才能使我的上传工作。非常感谢您的帮助。谢谢 最佳答案

c# - 通过 asp.net 访问 Office Word 对象模型导致 "failed due to the following error: 80070005 Access is denied."

我开发了一个网站,允许用户上传office文档,然后使用office对象模型将文档转换为HTML文件,然后在iFrame中显示该文件。当然,我已经包含了对Office.interop.word的引用,并且该站点在我的开发机器上运行良好。当我将它上传到我的生产服务器时,网站运行正常,直到我尝试上传文档。我最初得到一个类似的错误,说“COM对象未注册”。我意识到我的生产服务器上没有安装Word。所以我安装了word,现在当服务器尝试访问word对象模型时,我收到以下错误:检索CLSID为{000209FF-0000-0000-C000-000000000046}的组件的COM类工厂失败,原

c# - 可访问性不一致 : property type is less accessible

请有人帮忙解决以下错误:Inconsistentaccessibility:propertytype'Test.Delivery'islessaccessiblethanproperty'Test.Form1.thelivery'privateDeliverythedelivery;publicDeliverythedelivery{get{returnthedelivery;}set{thedelivery=value;}}由于不一致的错误消息,我无法运行该程序。这是我的交付类:namespaceTest{classDelivery{privatestringname;private

c# - 生成错误 : "The process cannot access the file because it is being used by another process"

我有一个C#webforms应用程序,直到今天它一直运行顺畅。现在,突然之间,每次我尝试运行该应用程序时,我都会收到文件锁定错误:Unabletocopyfile"obj\Debug\MyProject.exe"to"bin\Debug\MyProject.exe".Theprocesscannotaccessthefile"bin\Debug\MyProject.exe"becauseitisbeingusedbyanotherprocess.谷歌搜索错误并没有发现明显的错误,即VS认为文件已锁定。绝对锁定文件的是VisualStudio本身,因为当我关闭VS并重新打开它时,项目执行

c# - "Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions"错误

为什么我收到错误:Templatescanbeusedonlywithfieldaccess,propertyaccess,single-dimensionarrayindex,orsingle-parametercustomindexerexpressions在此代码处:@modelIEnumerable@{ViewBag.Title="Index";Layout="~/Views/Shared/_PageLayout.cshtml";}Index@Html.ActionLink("CreateNew","Create")@foreach(variteminModel){@Html.

c# - 跨线程操作无效 : Control 'textBox1' accessed from a thread other than the thread it was created on

这个问题在这里已经有了答案:Cross-threadoperationnotvalid:Controlaccessedfromathreadotherthanthethreaditwascreatedon(22个答案)关闭6年前。我想使用UART将温度值从微Controller发送到C#接口(interface)并在Label.Content上显示温度。这是我的微Controller代码:while(1){key_scan();//getvalueoftempif(Usart_Data_Ready()){while(temperature[i]!=0){if(temperature[i

c# - 不一致的可访问性 : Parameter type is less accessible than method

我试图在两种形式之间传递一个对象(基本上是对当前登录用户的引用)。目前,我在登录表单中有以下内容:privateACTInterfaceoActInterface;publicvoidbutton1_Click(objectsender,EventArgse){oActInterface=newACTInterface(@"\\actserver\Database\Premier.pad",this.textUser.Text,this.textPass.Text);if(oActInterface.checkLoggedIn()){//userhasauthedagainstACT,