I need to pass some values through php file located in localhost. I need to open that url via windows mobile 6 application. Please suggest me an easy way to do it. url is something like:

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

Regards.

P.S

I have tried connection manager, but it gives errors; "The name 'ConnMgrMapURL' does not exist in the current context"

有帮助吗?

解决方案 2

I've solved my problem by using HttpWebRequest method.

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;
        }

    }
}

}

其他提示

First, to be able to answer localhost requests you have to implement a web server.

Secondly your web server must implement the URL parsing to split the URL and the params.

Here is an example http://www.hjgode.de/wp/2012/10/19/windows-mobile-a-simple-web-server-with-extended-features/ but as you did not really describe your intention to be able to use

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

I do not know if the above artcle fits your needs.

Third: ConnMgrMapURL is not part of any standard Compact Framework runtime. There is an implentation of the native ConnMgr API for C# described at MSDN at http://msdn.microsoft.com/en-us/library/bb840031.aspx

Further reading about ConnMgr http://www.codeproject.com/Articles/98020/Using-the-Connection-Manager

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top