qul*_*zam 8 c# windows registry
我想在窗口注册表中注册我自己的项目扩展.我搜索谷歌,至少我发现这个代码,这很好用,但我不明白一行."%L"是什么意思.
C#代码是
string ext = ".ext";
RegistryKey key = Registry.ClassesRoot.CreateSubKey(ext);
MessageBox.Show(exePath);
key.SetValue("", "My Project");
key.Close();
key = Registry.ClassesRoot.CreateSubKey(ext + "\\Shell\\Open\\command");
//key = key.CreateSubKey("command");
key.SetValue("", "\"" + Application.ExecutablePath + "\" \"%L\"");
key.Close();
key = Registry.ClassesRoot.CreateSubKey(ext + "\\DefaultIcon");
key.SetValue("", Application.StartupPath + "\\icon.ico");
key.Close();
Run Code Online (Sandbox Code Playgroud)
这是困扰我的线,
key.SetValue("", "\"" + Application.ExecutablePath + "\" \"%L\"");
Run Code Online (Sandbox Code Playgroud)
请解释一下,我非常感谢你提前.
如果您的应用程序可执行文件在 C:\your dir\your program.exe 中,则该行将转换为:
"C:\你的目录\你的程序.exe" "%L"
%L 被转换为您正在打开的文件,因此您的程序正在执行将该文件作为第一个参数
| 归档时间: |
|
| 查看次数: |
4676 次 |
| 最近记录: |