本文整理汇总了VB.NET中System.Resources.MissingManifestResourceException类的典型用法代码示例。如果您正苦于以下问题:VB.NET MissingManifestResourceException类的具体用法?VB.NET MissingManifestResourceException怎么用?VB.NET MissingManifestResourceException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MissingManifestResourceException类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Main
' 导入命名空间
Imports System.IO
Imports System.Reflection
Imports System.Resources
Module Example
Public Sub Main()
If Environment.GetCommandLineArgs.Length = 1 Then
Console.WriteLine("No filename.")
Exit Sub
End If
Dim filename As String = Environment.GetCommandLineArgs(1).Trim()
' Check whether the file exists.
If Not File.Exists(filename) Then
Console.WriteLine("{0} does not exist.", filename)
Exit Sub
End If
' Try to load the assembly.
Dim assem As Assembly = Assembly.LoadFrom(filename)
Console.WriteLine("File: {0}", filename)
' Enumerate the resource files.
Dim resNames() As String = assem.GetManifestResourceNames()
If resNames.Length = 0 Then
Console.WriteLine(" No resources found.")
End If
For Each resName In resNames
Console.WriteLine(" Resource: {0}", resName.Replace(".resources", ""))
Next
Console.WriteLine()
End Sub
End Module