我是C#和Windows phone7开发的新手,在尝试使用Dropnet应用程序接口时,我遇到了一个错误:
using DropNet;
namespace Hello
{
public partial class App : Application
{
public PhoneApplicationFrame RootFrame { get; private set; }
public static DropNetClient DropNetClient { get; set; }
public App()
{
InitializeComponent();
InitializePhoneApplication();
DropNetClient = new DropNetClient("api key", "secret");
//I've correct app key and secret inserted here
DropNetClient.GetTokenAsync((userLogin) =>
{
//Dont really need to do anything with userLogin,
//DropNet takes care of it for now
},
(error) =>
{
//Handle error
});
var url = DropNetClient.BuildAuthorizeUrl();
//getting error here
}
}我得到的错误是
ArgumentNullException was unhandled
Value cannot be null
Parameter name: userLogin
根据http://dkdevelopment.net/what-im-doing/dropnet/,代码应该可以工作。请帮帮忙。
发布于 2012-04-16 23:30:36
引用自您提供的链接:
_client = new DropNetClient("API KEY", "API SECRET", "USER TOKEN", "USER SECRET");
// OR
_client = new DropNetClient("API KEY", "API SECRET");
_client.UserLogin = new UserLogin { Token = "USER TOKEN", Secret = "USER SECRET" };你错过了UserLogin初始化。
https://stackoverflow.com/questions/10176528
复制相似问题