static void Main(string[] args)
{
foreach(string arg in args)
{
Image img = Bitmap.FromFile(arg);
img.Save("c:\\xxxx.jpg",System.Drawing.Imaging.ImageFormat.Jpeg);
}
}我在注册表里这样建的 c:\app.exe %1 ,这样当在我的电脑中选择一个BMP文件时,是可以的,当选择多个的时候参数就传递不进来了,不知如何改注册表,才能在程序中取得选中的多个文件名
{
foreach(string arg in args)
{
Image img = Bitmap.FromFile(arg);
img.Save("c:\\xxxx.jpg",System.Drawing.Imaging.ImageFormat.Jpeg);
}
}我在注册表里这样建的 c:\app.exe %1 ,这样当在我的电脑中选择一个BMP文件时,是可以的,当选择多个的时候参数就传递不进来了,不知如何改注册表,才能在程序中取得选中的多个文件名
key1.CreateSubKey("bmp1");
key1.CreateSubKey("bmp2");
key1.CreateSubKey("bmp3");
RegistryKey key1 = Registry.CurrentUser.OpenSubKey("Software\\MyCompany\\MyApp\\Version1.0");
string bmp1 = key1.OpenSubKey("bmp1").GetValue().ToString();
string bmp2 = key1.OpenSubKey("bmp2").GetValue().ToString();