简体   繁体   English

vs2010 Express asp.net C#:facebook asp.net应用程序

[英]vs2010 express asp.net c#: facebook asp.net application

有没有人能够针对他们的本地主机从Facebook测试Facebook应用程序?

You'd first need to make sure your website running on localhost is visible to the internet. 您首先需要确保您在本地主机上运行的网站对互联网可见。 This can be a very complicated process that goes something like this: 这可能是一个非常复杂的过程,如下所示:

  • Ensure the website running on your machine is visible to other machines on the LAN. 确保您的计算机上运行的网站对局域网上的其他计算机可见。 If not, you may need to tweak your machine's firewall settings or website permissions. 如果没有,您可能需要调整计算机的防火墙设置或网站权限。 This will confirm that your website is capable of handling requests from other machines. 这将确认您的网站能够处理来自其他计算机的请求。

  • Assuming you use an ADSL modem to connect to the internet, you'll need to setup port forwarding (usually port 80) from your ADSL modem to your machine, which may also require your machine to have a static IP on your LAN. 假设您使用ADSL调制解调器连接到Internet,则需要设置从ADSL调制解调器到计算机的端口转发(通常是端口80),这也可能要求计算机在LAN上具有静态IP。 This will allow your website to handle requests from the internet, which would normally be blocked by the ADSL modem. 这将使您的网站能够处理来自Internet的请求,这些请求通常会被ADSL调制解调器阻止。

  • Assuming your internet IP address is dynamic, you'll need to use a Dynamic DNS service to map a host name (eg www.something.com) to your dynamic IP address. 假设您的Internet IP地址是动态的,则需要使用动态DNS服务将主机名(例如www.something.com)映射到您的动态IP地址。 I use no-ip.com for this, which is free and has never given me any issues. 我为此使用no-ip.com,它是免费的,并且从未给我任何问题。 The end result of this will be a hostname that will map to your ADSL modem, and ultimately, a URL that will map directly to your website running on localhost. 最终结果将是一个主机名,该主机名将映射到您的ADSL调制解调器,并且最终,一个URL将直接映射到您在localhost上运行的网站。

  • You may need to check with your ISP that the port you are running your website on is not being blocked by the ISP. 您可能需要与ISP确认,正在运行您的网站的端口未被ISP阻止。 My ISP does block a lot of ports, but provides an option to disable the blocking. 我的ISP确实阻止了许多端口,但是提供了一个禁用阻止的选项。

  • You need to do lots and lots of checking and fiddling to ensure that your website can handle requests from the internet. 您需要进行大量检查和摆弄,以确保您的网站可以处理来自互联网的请求。 A handy site for this is canyouseeme.org. 一个方便的网站是canyouseeme.org。 If this tool reports your website is not responding, then settle in for hours and hours of frustrating investigation and tweaking trying to get all of the above things working. 如果此工具报告您的网站没有响应,请花上几个小时进行令人沮丧的调查和调整,以使上述所有功能正常运行。 This is the worst part of the whole process! 这是整个过程中最糟糕的部分! But you never know, you may get it all working first try. 但是,您永远不知道,您可以先尝试全部操作。

Finally, you take your Dynamic DNS hostname, the incoming port your ADSL modem is listening to (usually 80), and the virtual directory of you website running on localhost and combine it into a single URL that you will then set as the Canvas URL in your Facebook app's settings. 最后,您获得动态DNS主机名,ADSL调制解调器正在侦听的传入端口(通常为80)以及在localhost上运行的网站的虚拟目录,并将其合并为一个URL,然后将其设置为Canvas URL。您的Facebook应用程序的设置。 So if my hostname was myfacebookapp.no-ip.com, my port was 80 and my website was living in a virtual directory called fbapp, my canvas URL would be http://myfacebookapp.no-ip.com/fbapp/ . 因此,如果我的主机名是myfacebookapp.no-ip.com,端口是80,并且网站位于一个名为fbapp的虚拟目录中,那么我的画布URL将是http://myfacebookapp.no-ip.com/fbapp/ You could also give the URL to one of your friends on the internet and ask them if they can see your website - if yes, then your localhost website is set up correctly! 您还可以将该URL提供给互联网上的一位朋友,并询问他们是否可以看到您的网站-如果可以,则您的本地主机网站设置正确!

All of the above steps, perhaps with the exception of the last one, require a fair amount of knowledge or experience to perform. 上述所有步骤(可能只有最后一个步骤除外)都需要相当多的知识或经验才能执行。 Let me know if you need more information on each one; 让我知道您是否需要每个方面的更多信息; if so, I'll try to find other stackoverflow pages that explain each step in greater detail. 如果是这样,我将尝试找到其他的stackoverflow页面,这些页面更详细地解释了每个步骤。

Yes, I have. 是的,我有。 I setup the connect URL to localhost/virtual, and it works for me. 我将连接URL设置为localhost / virtual,它对我有用。 Are you experiencing a problem? 您遇到问题了吗? Have you setup the app for the connect URL in the app settings on www.facebook.com/developers? 您是否已在www.facebook.com/developers上的应用程序设置中为连接URL设置了应用程序?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM