你好,我深化發展爲Windows和Mac是註冊一個URI方案註冊一個單聲道的應用程序的URI方案在OSX
static void RegisterURI()
{
if (Environment.OSVersion.Platform.ToString() == "Unix") //I'll never use it on any linux machine so it should be OK
{
//What should I put HERE ??
}
else
{
//on récupère le chemin de l'assembly
string MyPos = System.Reflection.Assembly.GetAssembly(typeof(Program)).Location;
var protocol = Registry.ClassesRoot
.CreateSubKey("serialcodereader");
protocol.SetValue("", "URL:Lancer l'écouteur de liseuse de code barre COM");
protocol.SetValue("URL Protocol", "");
var icon = protocol.CreateSubKey("DefaultIcon");
icon.SetValue("", MyPos + ",1");
var command = protocol.CreateSubKey("shell").CreateSubKey("open").CreateSubKey("command");
command.SetValue("", '"' + MyPos + '"');
}
}
這裏的應用程序是我使用的Windows代碼,但我該怎麼辦它適用於OSX?
PS:好的知道:我從來沒有使用過任何一臺Mac,甚至iPhone在我的生活,所以保持簡單蒙山:-)