0

I'm trying to make a console application which accesses my SkyDrive account, however I cannot figure out how to get the Live SDK working.

I'm running on Live SDK version 5.4 and this is the code I'm trying to run - the loginResult.Status is always "Unknown":

private static async Task<LiveConnectClient> ConnectToLive()
{
    LiveAuthClient authClient = new LiveAuthClient("my live ID");

    var loginResult = await authClient.IntializeAsync(new[] { "wl.basic" });
    if (loginResult.Status == LiveConnectSessionStatus.Connected)
        return new LiveConnectClient(loginResult.Session);
    return null;
}

A few things I'm not certain about (since the SDK documentation is somewhat lackluster at best):

  1. "My live ID" - is this just my e-mail address used for my personal Live account, or is it some sort of application specific ID that you have to create somewhere ?

  2. Is InitializeAsync the proper method to call for authenticating ? All examples I've found mention a "LoginAsync", but that method is not available in the DLL.

  3. Is it even possible to use the SDK outside of Windows Phone / Metro apps ?

Steffen
  • 13,648
  • 7
  • 57
  • 67
  • Hi Steffen, Did you find an answer to this, as I have same question? The examples in the LiveSDK show how to get a ClientID, and with that you can run the example (for me it as the Desktop ApiExplorer). But the login pops up a login window – jradxl Aug 07 '13 at 17:33

1 Answers1

0

I got the following code to work using a SkyDriveClient downloaded from http://skydriveapiclient.codeplex.com/releases/view/103081

    static void Main(string[] args)
    {
        var client = new SkyDriveServiceClient();

        client.LogOn("YourEmail@hotmail.com", "password");
        WebFolderInfo wfInfo = new WebFolderInfo();

        WebFolderInfo[] wfInfoArray = client.ListRootWebFolders();

        wfInfo = wfInfoArray[0];
        client.Timeout = 1000000000;

        string fn = @"test.txt";
        if (File.Exists(fn))
        {
            client.UploadWebFile(fn, wfInfo);
        }

    }
Nigel Findlater
  • 1,684
  • 14
  • 34