Gwan C#,如何获取HTTP头?

Gwan C#,如何获取HTTP头?,c#,g-wan,C#,G Wan,我需要它重写的网址,知道哪一个友好的网址我处理。用于用户代理和其他东西 编辑: 未处理的异常:System.MissingMethodException:找不到 请求的方法。at(包装器管理为本机)Gwan:getEnv (字符串,int) 我做错了什么 我想在你这方面,你需要放一些东西,比如: mono_add_internal_call ("Gwan::getEnv", get_env); 在没有加载gwan_api的/cs文件夹中的Dll中我认为您必须在他们的网站上查找支持信息或尝试使用

我需要它重写的网址,知道哪一个友好的网址我处理。用于用户代理和其他东西

编辑:

未处理的异常:System.MissingMethodException:找不到 请求的方法。at(包装器管理为本机)Gwan:getEnv (字符串,int)

我做错了什么

我想在你这方面,你需要放一些东西,比如:

mono_add_internal_call ("Gwan::getEnv", get_env);

在没有加载gwan_api的/cs文件夹中的Dll中

我认为您必须在他们的网站上查找支持信息或尝试使用代码来输出标题,尝试将其输出到messagebox.show(headersvariable)中;首先


与Java一样,G-WAN为G-WANCAPI创建了一些包装器。在这两种情况下(Java和C#),可以在
gwan/libraries/cs
目录下找到这些包装器

目前,C#wrapper是:

// 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库

希望这有帮助


编辑

您必须为希望从C#脚本支持的任何新G-WAN API(或外部函数)实现C#包装器

上面列出的include文件只是一个列表(不是实现)


有关更多详细信息,请参阅Mono文档。如果您想赞助您所需的功能,请在G-WAN上给我们留言。

有框架吗?对于GWAN?G-WAN,作为一个Web应用程序服务器(具有丰富的API),人们可能不觉得有必要创建一个现有框架之外的框架。但是,对于愿意使用“现成的”解决方案的人来说,有一定的空间,可以使用DB不可知的包装器,尤其是如果你考虑使用C/C++、C/java/Scala/PH7本地(以及因此SuffFAST)脚本的灵活性。我知道C脚本是可能的,但是我需要C语言的完整请求数据。我们可以创建某种框架来构建web应用程序。在部署到Gwan之前,帮助在Visual Studio中调试应用程序也是很有用的。请联系G-WAN团队以获取更多选项和个性化答案。
REQUEST_LEN, // int REQUEST_LEN // strlen(REQUEST); with headers 
HTTP_HEADERS, // struct *http_t; // see struct http_t above
HEAD_XBUF, // xbuf_t*HEAD_XBUF; // response HTTP headers(), if any 
// 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);
}