我需要它来重写 url,以了解我正在处理哪个友好的 url。用于用户代理和其他东西。
EDIT:
public class Gwan
{
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern public static long getEnv(string arg, int name);
}
Gwan.xbufCat(Gwan.getReply(args[0]), Gwan.getEnv(args[0], 3).ToString());
未处理的异常:System.MissingMethodException:找不到
要求的方法。 at(包装器管理到本机)Gwan:getEnv
(字符串,整数)
我究竟做错了什么?
我想你最后需要添加类似的内容:
mono_add_internal_call ("Gwan::getEnv", get_env);
/cs 文件夹中的 Dll,其中 gwan_api 也未加载
与 Java 一样,G-WAN 为 G-WAN C API 创建了一些包装器。在这两种情况下(Java 和 C#),这些包装器都可以在gwan/libraries/cs
目录。
目前,C# 包装器是:
// gwan_api.cs: exported G-WAN API calls for .NET C# servlets
using System;
using System.Runtime.CompilerServices;
public class Gwan
{
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern public static long getReply(string env);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern public static void xbufCat(long reply, string mono_reply);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern public static long cycles64();
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern public static long getNs ();
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern public static long getUs ();
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern public static long getMs ();
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern public static void logErr (long env, String msg);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern public static void report (long reply, int html_format);
}
但您可以通过添加更多包装器来自由扩展此文件,无论是针对 G-WAN C API 还是针对 G-WAN 脚本加载的第三方 C 库。
希望这可以帮助。
EDIT
您必须为您想要从 C# 脚本支持的任何新 G-WAN API(或外部函数)实现 C# 包装器。
上面列出的包含文件只是一个列表(不是实现)。
请参阅 Mono 文档了解更多详细信息 - 或者如果您想赞助您需要的功能,请致电 G-WAN。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)