Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/339.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 访问windows mobile 6中的url_C#_.net_Windows Mobile_Visual Studio 2005_Windows Mobile 6.5 - Fatal编程技术网

C# 访问windows mobile 6中的url

C# 访问windows mobile 6中的url,c#,.net,windows-mobile,visual-studio-2005,windows-mobile-6.5,C#,.net,Windows Mobile,Visual Studio 2005,Windows Mobile 6.5,我需要通过位于localhost中的php文件传递一些值。我需要通过windows mobile 6应用程序打开该url。请给我一个简单的方法。 url类似于: http://localhost/wlchr/index.php?data=Pharmacy&num=1 问候 附言 我尝试了连接管理器,但它给出了错误; “当前上下文中不存在名称“ConnMgrMapURL”首先,要能够响应本地主机请求,您必须实现web服务器 其次,web服务器必须实现URL解析以拆分URL和参数 这里是一

我需要通过位于localhost中的php文件传递一些值。我需要通过windows mobile 6应用程序打开该url。请给我一个简单的方法。 url类似于:

http://localhost/wlchr/index.php?data=Pharmacy&num=1
问候

附言


我尝试了连接管理器,但它给出了错误;
“当前上下文中不存在名称“ConnMgrMapURL”

首先,要能够响应本地主机请求,您必须实现web服务器

其次,web服务器必须实现URL解析以拆分URL和参数

这里是一个例子,但你没有真正描述你的意图,能够使用

http://localhost/wlchr/index.php?data=Pharmacy&num=1
我不知道上述物品是否适合你的需要

第三:ConnMgrMapURL不是任何标准Compact Framework运行时的一部分。MSDN中介绍了C#的本机ConnMgr API的实现


进一步阅读ConnMgr

我已经通过使用HttpWebRequest方法解决了我的问题

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;

namespace wlchrUrl
{
    class urlConn
    {
        public void DoConnect(string url)
        {
           Uri uri = new Uri(url);
        try
        {
            HttpWebRequest httpRequest = (HttpWebRequest)HttpWebRequest.Create(uri);
            HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse();
            Stream stream= httpResponse.GetResponseStream();

            httpResponse.Close();
            stream.Close();

        }
        catch(Exception ex)
        {
            throw ex;
        }

    }
}

}

那么,您尝试了什么?我尝试了连接管理器,但它会出错;“当前上下文中不存在名称‘ConnMgrMapURL’”什么连接管理器?连接到URL的C#代码在哪里?@RowlandShaw请参考上面的链接并通知我任何错误。当做