Tag: macos

可以在OSX .app包中包含Mono Runtimes吗?

我正在寻找一个需要在Windows和OSX上运行的应用程序。 由于我已经非常熟悉C#/ .NET,我想我会看一下使用Mono。 但我也希望它非常容易安装,并且不希望用户必须单独安装Mono软件包。 是否可以创建一个仅包含一切的OS X .app包? 那就是我的app,资源和完整的Mono运行时?

名称空间’System.Management’中不存在’ManagementClass’

嗨,我正在使用此方法获取mac地址 public string GetMACAddress() { System.Management.ManagementClass mc = default(System.Management.ManagementClass); ManagementObject mo = default(ManagementObject); mc = new ManagementClass(“Win32_NetworkAdapterConfiguration”); ManagementObjectCollection moc = mc.GetInstances(); foreach (var mo in moc) { if (mo.Item(“IPEnabled”) == true) { return mo.Item(“MacAddress”).ToString(); }else return null; } } 但我收到这个错误 Compiler Error Message: CS0234: The type or namespace name ‘ManagementClass’ does not exist in the […]

仅在Mac上使用C#/ Mono的系统托盘(无停靠图标)应用程序

我希望将我的一个C#应用程序移到Mono上,以便在Mac上使用。 目前,我正在试图弄清楚如何使它成为一种“背景”过程,但仍然具有GUI元素的能力(我相信这排除了mono-service )。 最终目标是: 对于大多数交互,按时钟放置托盘图标。 删除通常随启动的应用程序一起提供的停靠栏图标 让应用程序在启动时运行。 简而言之,只需考虑Dropbox应用程序的工作原理。 我想要那种类型的GUI,但使用Mono / Mac应用程序。 我相信这通常是通过在应用程序包的Info.plist中设置LSUIElement = 1来实现的。 但是,我没有运气。 我认为这可能与mono命令在app bundle中启动我的应用程序有关。 一旦应用程序启动mono我假设它不会级联到进一步的应用程序启动。 不过,这是一个纯粹的猜测。 有没有人对此有任何想法? 谢谢。

如何在Mac上使用Process.Start()或等效的Mono并传入参数

我正在尝试编写一些c#代码来使用Process.Start(app,args);启动浏览器Process.Start(app,args); 应用程序是浏览器的路径,例如/Applications/Google Chrome.app/Contents/MacOS/Google Chrome和args是–no-default-browser-check 如果我这样做,它适用于Windows和Linux Process.Start(“/Applications/Google Chrome.app/Contents/MacOS/Google Chrome”,”–no-first-run”); 我明白了 open: unrecognized option `–no-first-run’ Usage: open [-e] [-t] [-f] [-W] [-n] [-g] [-h] [-b ] [-a ] [filenames] Help: Open opens files from a shell. By default, opens each file using the default application for that file. If the file is in the form of a […]