Tag: mono

Mono将WebKit与GTK一起使用

我不得不说我是Mono的新手,我正在尝试使用GTK创建一个项目,并使用WebKit.WebView创建一个Window来加载一些html页面。 问题是:我只能在MonoMac项目中导入WebKit包。 在基于GTK的项目中,没有对WebKit的引用。 有人可以帮助我吗? 非常感谢。 F。

如何在GTK#Spin Button中正确对齐数字?

任何人都可以告诉我如何正确对齐GTK#spinbutton控件中的数字? 我不能为我的生活弄清楚它是如何在那里工作的。 文档稀疏,我只是在经过多次尝试后画了一个空白。 提前感谢您的回复。

无法获得Mono 2.10的Microsoft.VisualBasic.dll

我一直在尝试使用Mono将基于/ for Windows构建的.NET库移植到Ubuntu 11.04。 该库使用.NET 4.0,因此Ubuntu 11.04标准的mono(2.6.7)版本不会削减它。 具体来说,我正在尝试使用Microsoft.VisualBasic.Devices.Computer.Info.TotalPhysicalMemory。 我已经搜索了安装Microsoft.VisualBasic.dll的软件包或并行构建脚本的高低,但没有一个做到。 理想情况下,我想找到一种方法来充分利用这两个世界,支持.NET 4.0的Mono和Microsoft.VisualBasic,这样代码就不必修改了。 我会选择使用另一种方法的替代方法(尽管我在上一篇文章中看到的P / Invoke方法对我没有吸引力)。 任何帮助是极大的赞赏。

MonoDroid:Encoding.ASCII.GetString失败

间歇性地,Encoding.ASCII.GetString调用失败,exception会转义所有catch块并冻结应用程序。 private string ExecuteRequest(Uri url, KeyValuePair[] postItems = null) { var data = new byte[0]; var response = new byte[0]; using (var client = new WebClient()) { if (postItems != null && postItems.Count() > 0) { string dataString = string.Join(“&”, postItems.Select( item => string.Format(“{0}={1}”, item.Key, item.Value)).ToArray()); data = new ASCIIEncoding().GetBytes(dataString); } response = client.UploadData(url, “POST”, […]

如何在TreeView中获取鼠标指针下的项目(树节点)?

在GTK / GTK# TreeView ,如何获取鼠标指针当前hover的项目/节点?

使用和现有的.DLL文件构建Xamarin组件

我已经有一个使用.NET framework 4.0开发的.dll文件。 我想使用这个dll文件来构建一个Xamarin组件。 我正在按照指南https://components.xamarin.com/guidelines,但没有任何工作方式。 总是得到以下错误: Blockquote Unhandled Exception:Xamarin.Components.Packaging.InvalidPackageException:找不到lib directo ry,组件包中没有包含二进制文件。 在Xamarin.Components.Packaging.ComponentPackage.PopulateAvailableFrameworks()[0x00000] in:0中的Xamarin.Components.Packaging.ComponentPackage.Init()[0x00000] in:0 at Xamarin.Components.Packaging.ComponentPackage..ctor(System。字符串文件)[0 x00000] in:0 at Xamarin.Components.Packaging.Creation.PackageCreator.ValidatePackage(Syste m.String packagePath)[0x00000] in:0 at Xamarin.Components.CreateManuallyCommandHandler.Invoke(System.String [] arg s)[0x00000] in:0 [错误]致命未处理exception:Xamarin.Components.Packaging.InvalidPackageEx ception:找不到lib目录,组件包中没有包含二进制文件。 在Xamarin.Components.Packaging.ComponentPackage.PopulateAvailableFrameworks()[0x00000] in:0中的Xamarin.Components.Packaging.ComponentPackage.Init()[0x00000] in:0 at Xamarin.Components.Packaging.ComponentPackage..ctor(System。字符串文件)[0 x00000] in:0 at Xamarin.Components.Packaging.Creation.PackageCreator.ValidatePackage(Syste m.String packagePath)[0x00000] in:0 at Xamarin.Components.CreateManuallyCommandHandler.Invoke(System.String [] arg s)[0x00000] in:0 rake aborted! 命令失败,状态为(1):[mono xamarin-component / xamarin-component […]

为什么IAsyncResult将所有端口报告为已打开?

我有一个在线程中运行的方法,但是当我测试它时报告所有端口都是打开的。 似乎方法: var result = client.BeginConnect(host, port, null, null); 在var success = result.AsyncWaitHandle.WaitOne(tcpTimeout);传递结果时效果var success = result.AsyncWaitHandle.WaitOne(tcpTimeout); … 知道如何解决这个问题吗? 我试过client.ConnectAsync(host,port).Wait(TcpTimeout); 但这也没有按预期工作…. public void start() { Thread thread1 = new Thread(new ThreadStart(RunScanTcp)); thread1.IsBackground = true; thread1.Name = “THREAD ME EMER : ” + i; thread1.Priority = System.Threading.ThreadPriority.Highest; thread1.Start(); } public void RunScanTcp() { while (((port = portList.NextPort()) […]

在Mono上使用X509Certificate2 – 使用公钥和私钥加载?

现在,我尝试像这样实例化X509Certificate2: cert = new X509Certificate2(Resources.cred); 其中Resources.cred是表示.pfx文件的byte[] 。 这在Windows / .NET上完全正常。 但是,在Mono JIT编译器版本3.2.8(Debian 3.2.8 + dfsg-4ubuntu1) (Ubuntu Server 14.04 LTS上的Mono )下运行相同的代码,我得到以下exception: System.TypeInitializationException: An exception was thrown by the type initializer for —> System.Security.Cryptography.CryptographicException: Unable to decode certificate. —> System.Security.Cryptography.CryptographicException: Input data cannot be coded as a valid certificate. —> System.Security.Cryptography.CryptographicException: Input data cannot be coded as […]

DMCS中的D代表什么?

所以,我正在阅读有关mono c#编译器的内容 。 我知道应用程序的目的是什么,但我只是想知道缩写代表什么。 (gmcs,smcs和csc代表什么?) 如果我猜测它将是(Something)Mono Compiler Service。

如何实时读取输出并在需要时在特定时间停止

所以,我有这个工作代码来显示来自System.Diagnostics.Process ping和统计信息 Process P = new Process(); P.StartInfo.FileName = “ping”; P.StartInfo.Arguments = “-c 3 8.8.8.8”; // Take 3 samples to 8.8.8.8 P.StartInfo.UseShellExecute = false; P.StartInfo.RedirectStandardOutput = true; string readData = “”; if (P.Start()) readData = P.StandardOutput.ReadToEnd(); // This will also wait for the process to at least close its stdout Console.Write(readData.ToString()); // Doing this, you […]