Facebook共享功能在评论框中显示不完整的数据(Facebook share functionality shows incomplete data in the comment box)

系统教程 行业动态 更新时间:2024-06-14 17:04:03
Facebook共享功能在评论框中显示不完整的数据(Facebook share functionality shows incomplete data in the comment box)

我想在Facebook上发布一个链接,但是当点击分享按钮时它显示错误的数据,但同样的事情在Twitter共享中工作正常。

这是推特工作正常的代码:

private void btnTweetShare_Click(object sender, RoutedEventArgs e) { HtmlPage.Window.Navigate(new Uri(string.Format("http://twitter.com/share?url={0}", HttpUtility.UrlEncode(URLTextBox.Text))), "_blank"); }

以下是twitter分享的图片:

我想在Facebook上分享相同的数据,我的代码也相同,但它发布了无效数据。 我将数据作为QueryString传递给Url中的twitter和facebook。

private void btnFBShare_Click(object sender, RoutedEventArgs e) { HtmlPage.Window.Navigate(new Uri(string.Format("http://www.facebook.com/sharer.php?u={0}", HttpUtility.UrlEncode(URLTextBox.Text))), "_blank"); }

在图片下方,您可以看到Facebook分享评论框包含不完整的数据,这是我要发布的链接。

你可以看到,我希望复制完整的链接,但它只复制它的一部分。 即,而不是从查询字符串显示完整的值 它只显示了它的一部分,即localhost

非常感谢任何形式的帮助。 谢谢

I want to post a link on facebook but it shows wrong data when clicking on share button but the same thing works fine in twitter sharing.

Here is the code for Twitter that works fine:

private void btnTweetShare_Click(object sender, RoutedEventArgs e) { HtmlPage.Window.Navigate(new Uri(string.Format("http://twitter.com/share?url={0}", HttpUtility.UrlEncode(URLTextBox.Text))), "_blank"); }

Below is the image for twitter share:

I want to share the same data on facebook,my code is also same but it post invalid data. I am passing the data as QueryString in the Url for twitter and facebook.

private void btnFBShare_Click(object sender, RoutedEventArgs e) { HtmlPage.Window.Navigate(new Uri(string.Format("http://www.facebook.com/sharer.php?u={0}", HttpUtility.UrlEncode(URLTextBox.Text))), "_blank"); }

Below image you can see the facebook share comment box contains incomplete data which is a link that i want to post.

You can see ,i want complete link to be copied but it only copies a part of it. i.e., instead of showing complete value from querystring it only shows a part of it i.e., localhost .

Any kind of help is greatly appreciated. Thanks

最满意答案

你不能从localhost分享一些东西,看看localhost是什么: http : //en.wikipedia.org/wiki/Localhost

如果您想与sharer.php共享内容,则必须是每个人都可以使用的URL。 真正的公共服务器,具有真实域。

此外,sharer.php从共享URL获取Open Graph标记,更多内容如下: http ://ogp.me/

You cannot share something from localhost, check out what localhost is: http://en.wikipedia.org/wiki/Localhost

If you want to share something with sharer.php, it has to be an URL that is available to everyone. A real public server, with a real domain.

Also, sharer.php takes the Open Graph tags from the shared URL, here´s more about that: http://ogp.me/

更多推荐

本文发布于:2023-04-24 21:13:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/e9845ae3c389c6f0a8d3ca1f34df35a1.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:框中   不完整   功能   数据   share

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!