2011-07-29 4 views
1

코드 룸 프로젝트에 일부 리소스를 추가했지만 리소스에 액세스하는 방법이 없습니다. "내"키워드는 사용할 수 없습니다 그것은 작동하지 않습니다VB.NET에서 "My"를 사용하지 않고 Embedded Resources에 액세스하는 방법은 무엇입니까?

My.Resources.blabla.ToString 

가 어떻게 "내"키워드의 사용하지 않고 내 리소스에 액세스 할 수 있습니까?
My 네임 스페이스에 아무것도 TY

+0

진술을 사용하려는 위치에 대해 더 많은 정보를 제공 할 수 있습니까? – jonsca

+0

코드 롬 EmbeddedResources 메소드가있는 리소스를 추가했는데 코드 om이 나를 위해 exe를 컴파일했습니다 - 내 exe에서 임베디드 리소스에 액세스 할 수 있기를 원하지만 어떻게 될지 모릅니다. – MilMike

답변

1

, 당신은 (예 : blabla 등) 용어를 마우스 오른쪽 버튼으로 클릭하고 정의에 이동을 선택할 수 있습니다. My 네임 스페이스 뒤의 코드를 표시하거나 전체 클래스 이름을 표시 할 개체 참조로 안내합니다.

귀하의 경우 귀하의 목적에 맞게이 네임 스페이스를 다시 작성할 수 있습니다.

Namespace My.Resources 

    '''<summary> 
    ''' A strongly-typed resource class, for looking up localized strings, etc. 
    '''</summary> 
    <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ 
    Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ 
    Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ 
    Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ 
    Friend Module Resources 

     Private resourceMan As Global.System.Resources.ResourceManager 

     Private resourceCulture As Global.System.Globalization.CultureInfo 

     '''<summary> 
     ''' Returns the cached ResourceManager instance used by this class. 
     '''</summary> 
     <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ 
     Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager 
      Get 
       If Object.ReferenceEquals(resourceMan, Nothing) Then 
        Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WindowsApplication1.Resources", GetType(Resources).Assembly) 
        resourceMan = temp 
       End If 
       Return resourceMan 
      End Get 
     End Property 

     '''<summary> 
     ''' Overrides the current thread's CurrentUICulture property for all 
     ''' resource lookups using this strongly typed resource class. 
     '''</summary> 
     <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ 
     Friend Property Culture() As Global.System.Globalization.CultureInfo 
      Get 
       Return resourceCulture 
      End Get 
      Set(value As Global.System.Globalization.CultureInfo) 
       resourceCulture = Value 
      End Set 
     End Property 

     '''<summary> 
     ''' Looks up a localized string similar to Blah. 
     '''</summary> 
     Friend ReadOnly Property String1() As String 
      Get 
       Return ResourceManager.GetString("String1", resourceCulture) 
      End Get 
     End Property 
    End Module 
End Namespace