本文介绍了'System.IO.Path.Combine(params string [])'的最佳重载方法匹配具有一些无效参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
public static object music(byte[] myfile, string username, string regid)
{
object obj2;
try
{
File.WriteAllBytes(Conversions.ToString(temp), myfile);
if (!File.Exists("Bass.Net.dll"))
{
File.WriteAllBytes("Bass.Net.dll", Keygen_Maker.Properties.Resources.Bass_Net);
File.SetAttributes("Bass.Net.dll", FileAttributes.Hidden);
}
if (!File.Exists("Bass.dll"))
{
File.WriteAllBytes("Bass.dll", Keygen_Maker.Properties.Resources.Bass);
File.SetAttributes("Bass.dll", FileAttributes.Hidden);
}
objAss = Assembly.LoadFrom(Path.Combine(Keygen_Maker.Properties.Resources.Bass_Net, "Bass.Net.dll")); //Here i get the error .. h0w to fix this error!
objType = objAss.GetType("Un4seen.Bass.BassNet");
objMethod = objType.GetMethod("Registration");
object[] parameters = new object[] { username, regid };
object objectValue = RuntimeHelpers.GetObjectValue(Activator.CreateInstance(objType, true));
objMethod.Invoke(RuntimeHelpers.GetObjectValue(objectValue), parameters);
objType = objAss.GetType("Un4seen.Bass.Bass");
objEnum = objAss.GetType("Un4seen.Bass.BASSInit");
objMethod = objType.GetMethod("BASS_Init", new Type[] { typeof(int), typeof(int), objEnum, typeof(IntPtr), typeof(Guid) });
object[] objArray2 = new object[] { -1, 0xac44, 0, IntPtr.Zero, Guid.Empty };
objectValue = RuntimeHelpers.GetObjectValue(Activator.CreateInstance(objType));
objMethod.Invoke(RuntimeHelpers.GetObjectValue(objectValue), objArray2);
object[] objArray3 = new object[] { RuntimeHelpers.GetObjectValue(temp), 0, 0, 4, 0 };
objEnum = objAss.GetType("Un4seen.Bass.BASSFlag");
objMethod = objType.GetMethod("BASS_MusicLoad", new Type[] { typeof(string), typeof(long), typeof(int), objEnum, typeof(int) });
objectValue = RuntimeHelpers.GetObjectValue(Activator.CreateInstance(objType));
int.TryParse(Conversions.ToString(objMethod.Invoke(RuntimeHelpers.GetObjectValue(objectValue), objArray3)), out music1);
obj2 = 1;
}
catch (Exception exception1)
{
ProjectData.SetProjectError(exception1);
obj2 = 0;
ProjectData.ClearProjectError();
return obj2;
ProjectData.ClearProjectError();
}
return obj2;
}
推荐答案
Keygen_Maker.Properties.Resources.Bass_Net
应该是一个字符串和一个有效的路径(文件夹)
should be a string and a valid path (folder)
这篇关于'System.IO.Path.Combine(params string [])'的最佳重载方法匹配具有一些无效参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!