如何将这个PHP Facebook“Like status”应用程序转换为C#(.NET)?

时间:2011-04-26 16:08:36

标签: c# php facebook

本教程(http://bit.ly/hYEVYF)有助于熟悉C#& Visual Studio,但它实现了不同的目标。

这是PHP代码(完美地运行):

<?php require 'lib/facebook.php';

$facebook = new Facebook( array( 
  'appId'   => APP_ID,
  'secret'  => APP_SECRET,
  'cookie'  => true
) );

try {
  $me = $facebook->api('/me');
} catch ( FacebookApiException $e ) {
  error_log( $e );
}

$signed_request = $facebook->getSignedRequest();
$liked = $signed_request['page']['liked'];

?>

<?php
if ( $liked ) : ?>
  YOU LIKE US!
<?php else : ?>
  YOU DON'T LIKE US YET!
<?php endif; ?>

<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>

1 个答案:

答案 0 :(得分:0)

使用Facebook C# SDK