小编Dan*_*ner的帖子

Windows Phone上的LDAP身份验证

在当前项目中,我想检查用户是否是他所说的用户(不涉及私人数据).那个项目主要是关于我大学的时间表.由于我们有一个LDAP服务器,并且每个学生都有一个帐户,我想对LDAP服务器进行身份验证,但Windows Phone上没有System.DirectoryServices程序集.有没有人知道如何通过Web服务实现解决方案的登录期望?WCF不是一个选项,我理论上可以将数据发送到Web服务并通过PHP进行身份验证,但我想在应用程序中保留该功能.

提前致谢!

c# ldap windows-phone-7

7
推荐指数
1
解决办法
787
查看次数

使用Google PHP SDK的YouTube API - 响应为JSON

对于我最新的项目,我需要将YouTube搜索结果作为JSON字符串.我试图从这里修改官方Samples的代码,以便整个响应数组作为JSON返回,但JSON输出只包含一个结果,只有两个结果的标记

{ "ETAG": "\" bvxF-DWHx1toJotsdJBeCm43SLs/Ti9GPWl-tTk2fzo_W4M7px11bPY\"", "事件ID":空, "种": "YouTube的#searchListResponse" 的 "nextPageToken": "CBkQAA", "prevPageToken":空" visitorId":空}

这就是我的代码:

<?php
header('Cache-Control: no-cache, must-revalidate');
header('Content-type: application/json');
if ($_GET['q'] && $_GET['maxResults']) {
require_once 'Google/Client.php';
require_once 'Google/Service/YouTube.php';
$DEVELOPER_KEY = 'not gonna reveal my key ;) ';
$client = new Google_Client();
$client->setDeveloperKey($DEVELOPER_KEY);
$youtube = new Google_Service_YouTube($client);
try 
{
    $searchResponse = $youtube->search->listSearch('id,snippet', array(
        'q' => $_GET['q'],
        'maxResults' => $_GET['maxResults'],
    ));
    print_r(json_encode($searchResponse));
} 
catch (Google_ServiceException $e) {
    $htmlBody .= sprintf('<p>A service error occurred: <code>%s</code></p>',
    htmlspecialchars($e->getMessage()));
} 
catch (Google_Exception $e) …
Run Code Online (Sandbox Code Playgroud)

php youtube json youtube-data-api

3
推荐指数
1
解决办法
830
查看次数

标签 统计

c# ×1

json ×1

ldap ×1

php ×1

windows-phone-7 ×1

youtube ×1

youtube-data-api ×1