当前位置: 首页>>代码示例>>C#>>正文


C# AssemblyInfo.GetAssemblyFullName方法代码示例

本文整理汇总了C#中AssemblyInfo.GetAssemblyFullName方法的典型用法代码示例。如果您正苦于以下问题:C# AssemblyInfo.GetAssemblyFullName方法的具体用法?C# AssemblyInfo.GetAssemblyFullName怎么用?C# AssemblyInfo.GetAssemblyFullName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AssemblyInfo的用法示例。


在下文中一共展示了AssemblyInfo.GetAssemblyFullName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ResolveAssembly

 internal static Assembly ResolveAssembly(object sender, ResolveEventArgs e)
 {
     AssemblyInfo info = new AssemblyInfo(e.Name);
     string assemblyFullName = info.GetAssemblyFullName(false);
     string str2 = Convert.ToBase64String(Encoding.UTF8.GetBytes(assemblyFullName));
     string[] strArray = "ezJiMjQwNDRmLTY0NDgtNDczMi1hMGQ4LTlhNGIzNzg0MWY0N30sIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49M2U1NjM1MDY5M2Y3MzU1ZQ==,[z]{5afba4e7-4cbd-48f4-ae87-5cb4a100aac0},ezJiMjQwNDRmLTY0NDgtNDczMi1hMGQ4LTlhNGIzNzg0MWY0N30=,[z]{5afba4e7-4cbd-48f4-ae87-5cb4a100aac0},SHRtbEFnaWxpdHlQYWNrLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWJkMzE5YjE5ZWFmM2I0M2E=,[z]{22a11d39-8946-4a47-958b-a3b1fb426f2d},SHRtbEFnaWxpdHlQYWNr,[z]{22a11d39-8946-4a47-958b-a3b1fb426f2d}".Split(new char[] { ',' });
     string key = string.Empty;
     bool flag = false;
     bool flag2 = false;
     for (int i = 0; i < (strArray.Length - 1); i += 2)
     {
         if (strArray[i] == str2)
         {
             key = strArray[i + 1];
             break;
         }
     }
     if ((key.Length == 0) && (info.PublicKeyToken.Length == 0))
     {
         str2 = Convert.ToBase64String(Encoding.UTF8.GetBytes(info.Name));
         for (int j = 0; j < (strArray.Length - 1); j += 2)
         {
             if (strArray[j] == str2)
             {
                 key = strArray[j + 1];
                 break;
             }
         }
     }
     if (key.Length > 0)
     {
         if (key[0] == '[')
         {
             int index = key.IndexOf(']');
             string str4 = key.Substring(1, index - 1);
             flag = str4.IndexOf('z') >= 0;
             flag2 = str4.IndexOf('t') >= 0;
             key = key.Substring(index + 1);
         }
         lock (hashtable)
         {
             if (hashtable.ContainsKey(key))
             {
                 return hashtable[key];
             }
             Stream manifestResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(key);
             if (manifestResourceStream != null)
             {
                 int length = (int) manifestResourceStream.Length;
                 byte[] buffer = new byte[length];
                 manifestResourceStream.Read(buffer, 0, length);
                 if (flag)
                 {
                     buffer = SimpleZip.Unzip(buffer);
                 }
                 Assembly assembly = null;
                 if (!flag2)
                 {
                     try
                     {
                         assembly = Assembly.Load(buffer);
                     }
                     catch (FileLoadException)
                     {
                         flag2 = true;
                     }
                     catch (BadImageFormatException)
                     {
                         flag2 = true;
                     }
                 }
                 if (flag2)
                 {
                     try
                     {
                         string path = string.Format(@"{0}{1}\", Path.GetTempPath(), key);
                         Directory.CreateDirectory(path);
                         string str6 = path + info.Name + ".dll";
                         if (!File.Exists(str6))
                         {
                             FileStream stream2 = File.OpenWrite(str6);
                             stream2.Write(buffer, 0, buffer.Length);
                             stream2.Close();
                             MoveFileEx(str6, null, 4);
                             MoveFileEx(path, null, 4);
                         }
                         assembly = Assembly.LoadFile(str6);
                     }
                     catch
                     {
                     }
                 }
                 hashtable[key] = assembly;
                 return assembly;
             }
         }
     }
     return null;
 }
开发者ID:CyberFoxHax,项目名称:PCSXBonus,代码行数:99,代码来源:AssemblyResolverHelper.cs


注:本文中的AssemblyInfo.GetAssemblyFullName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。