0

这里的一位用户给了我一个适用于 Android 的 HtmlAgilityPack。我的问题是如何在 MonoDevelop (Mono for Android - C#) 中使用它?

4

1 回答 1

1

您必须从代码中编译它
下载源代码

进入

\htmlagilitypack-99964\Branches\1.4.0\HtmlAgilityPack

csproj将更改编辑为

<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />

保存并加载

修正错误

跟踪 -> 调试

删除块

 if (!SecurityManager.IsGranted(new DnsPermission(PermissionState.Unrestricted)))
        {
            //do something.... not at full trust
            try
            {
                RegistryKey reg = Registry.ClassesRoot;
                reg = reg.OpenSubKey(extension, false);
                if (reg != null) contentType = (string)reg.GetValue("", def);
            }
            catch (Exception)
            {
                contentType = def;
            }
        }

删除块

 if (SecurityManager.IsGranted(new RegistryPermission(PermissionState.Unrestricted)))
        {
            try
            {
                RegistryKey reg = Registry.ClassesRoot;
                reg = reg.OpenSubKey(@"MIME\Database\Content Type\" + contentType, false);
                if (reg != null) ext = (string)reg.GetValue("Extension", def);
            }
            catch (Exception)
            {
                ext = def;
            }
        }

使用文件夹dll中的bin/debug

于 2013-03-18T07:27:00.363 回答