GVKun编程网logo

BC30451“VARIABLE”未被声明 由于其保护级别,可能无法访问(amos未声明 它可能因其保护级别而不可访问)

43

这篇文章主要围绕BC30451“VARIABLE”未被声明由于其保护级别,可能无法访问和amos未声明它可能因其保护级别而不可访问展开,旨在为您提供一份详细的参考资料。我们将全面介绍BC30451“V

这篇文章主要围绕BC30451“VARIABLE”未被声明 由于其保护级别,可能无法访问amos未声明 它可能因其保护级别而不可访问展开,旨在为您提供一份详细的参考资料。我们将全面介绍BC30451“VARIABLE”未被声明 由于其保护级别,可能无法访问的优缺点,解答amos未声明 它可能因其保护级别而不可访问的相关问题,同时也会为您带来asp.net – ‘txtName’未声明 由于其保护等级可能无法访问、asp.net – 由于其保护级别,未声明变量可能无法访问、asp.net-identity – 由于其保护级别,Microsoft.Owin.Security.AuthenticationManager’无法访问、c# – Mono说’System.Net.Dns.GetHostEntry(string)’由于其保护级别而无法访问的实用方法。

本文目录一览:

BC30451“VARIABLE”未被声明 由于其保护级别,可能无法访问(amos未声明 它可能因其保护级别而不可访问)

BC30451“VARIABLE”未被声明 由于其保护级别,可能无法访问(amos未声明 它可能因其保护级别而不可访问)

我好像在下面的代码有错误。

Private Sub Form1_Load(sender As Object,e As EventArgs) Handles MyBase.Load Me.CenterToScreen() If My.Computer.FileSystem.FileExists("binPHPPHP.exe") Then Dim PHPRC As String = "" Dim PHP_BINARY As String = "binPHPPHP.exe" Else Dim PHP_BINARY As String = "PHP" End If If My.Computer.FileSystem.FileExists("Pocketmine-MP.phar") Then Dim POCKETmine_FILE As String = "Pocketmine-MP.phar" Else If My.Computer.FileSystem.FileExists("srcpocketminePocketmine.PHP") Then Dim POCKETmine_FILE As String = "srcpocketminePocketmine.PHP" Else MsgBox("Couldn't find a valid Pocketmine-MP installation",MsgBoxStyle.Exclamation,"Pocketmine-MP") End If End If Process.Start("C:UsersdamianDesktopGamesPocketmineInstallerPocketmine-MPbinmintty.exe","-o Columns=88 -o Rows=32 -o AllowBlinking=0 -o FontQuality=3 -o Font='DejaVu Sans Mono' -o FontHeight=10 -o CursorType=0 -o CursorBlinks=1 -h error -t 'Pocketmine-MP' -i bin/pocketmine.ico -w max" & PHP_BINARY & "" & POCKETmine_FILE & "" & "--enable-ansi") End Sub

我一直在得到这个错误

BC30451'PHP_BINARY'未被声明。 由于其保护级别,可能无法访问。

未声明BC30451“POCKETmine_FILE”。 由于其保护级别,可能无法访问。

Git for Windows在<enter>上粘贴剪贴板

打开文件到一个已有的vim会话(Cygwin / mintty)

如何自动化cygwin和mintty

如何在Windows上使用git + mintty + mingw获取彩色输出?

Git(windows); 作为mergetool错误的P4merge

我究竟做错了什么?

(仅供testing使用,仅限于Form1_Load)。

使用python与(Cygwin(mintty)中的(执行命令)进行通信并获取输出

如果在Git bash(mintty)中使用npm脚本,则无法使用控制台颜色

你正在调暗if语句中的两个变量,所以一旦你点击“end if”,你的变量就消失了,或者“超出了范围”。 你当然应该对变量的范围做一些研究…为了解决这个问题,首先在你的if语句之外,在sub的内部声明字符串。 然后使用if语句来改变变量的含义; 这样,当你的进程调用出现时,变量将不会超出范围:

Private Sub Form1_Load(sender As Object,e As EventArgs) Handles MyBase.Load Me.CenterToScreen() Dim PHP_BINARY As String = nothing Dim POCKETmine_FILE As String = nothing If My.Computer.FileSystem.FileExists("binPHPPHP.exe") Then PHP_BINARY = "binPHPPHP.exe" Else PHP_BINARY = "PHP" End If If My.Computer.FileSystem.FileExists("Pocketmine-MP.phar") Then POCKETmine_FILE = "Pocketmine-MP.phar" Else If My.Computer.FileSystem.FileExists("srcpocketminePocketmine.PHP") Then POCKETmine_FILE = "srcpocketminePocketmine.PHP" Else MsgBox("Couldn't find a valid Pocketmine-MP installation","-o Columns=88 -o Rows=32 -o AllowBlinking=0 -o FontQuality=3 -o Font='DejaVu Sans Mono' -o FontHeight=10 -o CursorType=0 -o CursorBlinks=1 -h error -t 'Pocketmine-MP' -i bin/pocketmine.ico -w max" & PHP_BINARY & "" & POCKETmine_FILE & "" & "--enable-ansi") End Sub

asp.net – ‘txtName’未声明 由于其保护等级可能无法访问

asp.net – ‘txtName’未声明 由于其保护等级可能无法访问

当我编译文本框后,我收到上面的错误:

‘txtName’未声明。由于其保护等级可能无法访问。

当我尝试在codebehind页面中读取文本框的值时,会发生这种情况。

我不知道是什么造成这个…任何想法?

在aspx文件中我有:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="signup.aspx.vb" Inherits="signup" %>

在codebehind aspx.vb文件中我有:

Imports System.Data.sqlClient
Partial Class signup
    Inherits System.Web.UI.Page

    Protected Sub btnSubmit_Click(ByVal sender As Object,ByVal e As System.EventArgs) Handles btnSubmit.Click

解决方法

好的,我现在解决了。这是因为我已经重命名了.aspx文件的副本,并且仍然使用文件后面的较新版本的代码。

文件中的代码正在寻找txtName.text,但是在.aspx文件的较旧版本txtName不存在!

我已经从项目中排除了旧版本的页面,现在似乎运行正常。

感谢大家帮忙。

asp.net – 由于其保护级别,未声明变量可能无法访问

asp.net – 由于其保护级别,未声明变量可能无法访问

我的VB技能不是最好的,这个问题让我难以忍受了几天.

在Visual Studio中显示的控件列表中,未在后面的代码中定义,我可以“鼠标悬停”它们,工具提示文本会弹出.

类似的问题:

这个没有@R_301_6256@案 – ‘var_name’is not declared. It may be inaccessible due to its protection level.’ in debug mode

这个说@R_301_6256@案是在web.config中,但我不明白在哪里/如何 – BC30451: ‘MailValidation’ is not declared. It may be inaccessible due to its protection level

这是一个拼写错误的单词 – vb.net error: inaccessible due to its protection level

更新 – 这是另一个问题,可能是我的问题的线索:

在我的Tools.vb模块中,我有一个访问LDAP的类.

工具类的命名空间在login.aspx.vb代码中给出,但登录代码无法识别工具类.

解决方法

密切关注错误的第一部分:“未声明变量”

忽略第二部分:“由于其保护级别,它可能无法访问”.这是一个红鲱鱼.

一些问题……(答案可能在你发布的那张图片中,但我似乎无法让它变得更大,我的眼睛看不到那么小的印刷品……你有可能以某种方式发布代码这些年纪较大的眼睛可以阅读它吗?很难知道整个画面.特别是我怀疑你的Page指令.)

我们知道1stReasonTypes是一个列表框,但由于某种原因,我们似乎不知道哪个列表框.这就是我想看到你的页面指令的原因.

但是,你如何调用私有方法FormRefresh()?它不是一个事件处理程序,这让我想知道你是否试图引用一个在这段代码中处理不当的表单中的列表框.

您可能需要找到控件1stReasonTypes.尝试将列表框放在类似的内容中

<div id="MyFormDiv" runat="server">.....</div>

然后在FormRefresh()中,做一个……

Dim 1stReasonTypesNew As listBox = MyFormDiv.FindControl("1stReasonTypes")

或者使用现有的控件,对象或页面而不是div.有关FindControl的更多信息:
http://msdn.microsoft.com/en-us/library/486wc64h(v=vs.110).aspx

但无论你如何分割它,这里有一些时髦的东西,以至于1stReasonTypes不知道它应该是哪个精确的列表框.

asp.net-identity – 由于其保护级别,Microsoft.Owin.Security.AuthenticationManager’无法访问

asp.net-identity – 由于其保护级别,Microsoft.Owin.Security.AuthenticationManager’无法访问

我正在尝试实现ASP.NET Identity 2.0.我在VS 2012中创建了一个MVC4项目,并使用Nu Get命令安装了ASP.NET Identity 2.0软件包.我收到编译错误消息“Microsoft.Owin.Security.AuthenticationManager”由于其保护级别而无法访问,具有以下代码.

获取编译错误,因为AuthenticationManager是程序集EntityFramework.dll中的内部类.
因此,我可以从AuthenticationManager派生一个类并调用公共方法SignIn()和SignOut().

在同一个程序集中有一个AuthenticationManagerExtensions类.我怎样才能将它用于SignIn和SignOut?

using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using System.Threading.Tasks;
using Microsoft.Owin.Security;

    private async Task SignInAsync(ApplicationUser user,bool isPersistent)
    {
        AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie);

        var identity = await UserManager.CreateIdentityAsync(
           user,DefaultAuthenticationTypes.ApplicationCookie);

        AuthenticationManager.SignIn(
           new AuthenticationProperties()
           {
               IsPersistent = isPersistent
           },identity);
    }

解决方法

此处使用的AuthenticationManager是当前Owin上下文的Authentication对象.通过在同一个类中添加以下属性来解决此问题.

private IAuthenticationManager AuthenticationManager
    {
        get
        {
            return HttpContext.GetowinContext().Authentication;
        }
    }

c# – Mono说’System.Net.Dns.GetHostEntry(string)’由于其保护级别而无法访问

c# – Mono说’System.Net.Dns.GetHostEntry(string)’由于其保护级别而无法访问

我正在上课,其中一些例子在C#中.由于我的笔记本电脑运行 Linux,我在Ubuntu上使用Mono 2.6.7.

我正在尝试编译以下代码:

using System.Net.sockets;
using System.Net;
using System;

/// <summary>
/// Example program showing simple TCP socket connections in C#.NET.
/// Rather than reading and writing byte arrays,this example show
/// how to use a stream reader in the client.
/// TcpsocketServer is the socket server.
/// <author>Tim Lindquist ASU polytechnic Department of Engineering</author>
/// <version>September,2009</version>
/// </summary>
public class TcpsocketServer {

  public static void Main (string [] args) {
    IPAddress ipAddress = Dns.GetHostEntry("localhost").AddressList[0];
    TcpListener tcpl = new TcpListener(ipAddress,9090);
    tcpl.Start();
    Console.WriteLine("TcpsocketServer waiting for connections on 9090");
    Socket sock = tcpl.AcceptSocket();
    string msg = "Hello Client";
    Byte[] msgBytes = System.Text.Encoding.ASCII.GetBytes(msg);
    sock.Send(msgBytes,msgBytes.Length,SocketFlags.DontRoute);
    Console.WriteLine("Message-Hello Client-sent to client.");
    tcpl.Stop();
    sock.Close();
  }
}

当我编译代码时,我得到:

/home/vivin/Projects/cst420/CSSockets/src/TcpsocketServer.cs(16,31): error CS0122: `System.Net.Dns.GetHostEntry(string)' is inaccessible due to its protection level
/usr/lib/mono/gac/System/1.0.5000.0__b77a5c561934e089/System.dll (Location of the symbol related to prevIoUs error)
ompilation Failed: 1 error(s),0 warnings

我是C#新手;这是我编写的第一个C#程序.我尝试在谷歌上搜索,但我没有得到很多关于这个问题的点击.这是Mono的问题吗?

解决方法

System.Net.Dns.GetHostEntry是在.NET Framework 2.0中引入的.在Mono的实现中,它也出现在2.0之前的版本中,但标记为内部而非公共.您似乎正在编译.NET Framework 1.0.

/mcs/class/System/System.Net/Dns.cs开始:

#if NET_2_0
    public
#else
    internal
#endif
    static IPHostEntry GetHostEntry (string hostNameOrAddress)
    {
        // ...

我们今天的关于BC30451“VARIABLE”未被声明 由于其保护级别,可能无法访问amos未声明 它可能因其保护级别而不可访问的分享已经告一段落,感谢您的关注,如果您想了解更多关于asp.net – ‘txtName’未声明 由于其保护等级可能无法访问、asp.net – 由于其保护级别,未声明变量可能无法访问、asp.net-identity – 由于其保护级别,Microsoft.Owin.Security.AuthenticationManager’无法访问、c# – Mono说’System.Net.Dns.GetHostEntry(string)’由于其保护级别而无法访问的相关信息,请在本站查询。

本文标签: