小编San*_*ndy的帖子

如何从windows phone 7中的javascript调用ac#方法?

我想使用JavaScript检测C#中的Web浏览器控件中的滑动.我想在我的网页内容中添加一些JavaScript,然后如果发生滑动,请调用一个方法,在同一个Web浏览器控件中加载另一个Web内容.

我想要一些示例代码或任何其他建议来执行此操作.

提前致谢

webbrowser-control windows-phone-7 swipe-gesture

0
推荐指数
1
解决办法
596
查看次数

Unauthorizedaccessexception {"无效的跨线程访问."} ...正在发生

我想用bitly来缩短我的url,但是当我想在我的文本块中设置字符串时会发生异常

    private void button1_Click(object sender, RoutedEventArgs e)
    {
        ShortenUrl(textBox1.Text);
    }
    enum Format
    {
        XML,
        JSON,
        TXT
    }

    enum Domain
    {
        BITLY,
        JMP
    }

    void ShortenUrl(string longURL)
    {
        Format format = Format.XML;
     Domain   domain = Domain.BITLY;
        string _domain;
        //string output;

        // Build the domain string depending on the selected domain type
        if (domain == Domain.BITLY)
            _domain = "bit.ly";
        else
            _domain = "j.mp";

        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(
            string.Format(@"http://api.bit.ly/v3/shorten?login={0}&apiKey={1}&longUrl={2}&format={3}&domain={4}",
            "username", "appkey", HttpUtility.UrlEncode(longURL), format.ToString().ToLower(), _domain));

        request.BeginGetResponse(new AsyncCallback(GetResponse), request);

    }
    void GetResponse(IAsyncResult result)
    {
        XDocument …
Run Code Online (Sandbox Code Playgroud)

windows-phone-7

0
推荐指数
1
解决办法
2022
查看次数