static void Main() { // Instantiate SkyDrive API client var sky_drive_client = new SkyDriveServiceClient(); try { // Log on to a user account sky_drive_client.LogOn("*****@*****.**", "aquiFapoin"); // Get SkyDrive storage info var webDriveInfo = sky_drive_client.GetWebDriveInfo(); // List folders in SkyDrive's root var rootWebFolders = sky_drive_client.ListRootWebFolders(); } catch (Exception ex) { Console.WriteLine(ex); Console.ReadLine(); } finally { // Clean up } }
static void Main() { // Instantiate SkyDrive API client var sky_drive_client = new SkyDriveServiceClient(); try { // Log on to a user account sky_drive_client.LogOn("*****@*****.**", "aquiFapoin"); // Get SkyDrive storage info var webDriveInfo = sky_drive_client.GetWebDriveInfo(); // List folders in SkyDrive's root var rootWebFolders = sky_drive_client.ListRootWebFolders(); } catch (Exception ex) { Console.WriteLine(ex); Console.ReadLine(); } finally { // Clean up } }
public string SaveImageToCloud(Image image, string imageName) { String urlToReturn = null; var client = new SkyDriveServiceClient(); client.LogOn("*****@*****.**", "Y)rm91234"); WebFolderInfo wfInfo = new WebFolderInfo(); WebFolderInfo[] wfInfoArray = client.ListRootWebFolders(); wfInfo = wfInfoArray[0]; client.Timeout = 1000000000; var serverUploadFolder = Path.GetTempPath(); image.Save(Path.Combine(serverUploadFolder, imageName)); var localFilePath = Path.Combine(serverUploadFolder, imageName); //string fn = @"test.txt"; if (File.Exists(localFilePath)) { var webFileInfo = client.UploadWebFile(localFilePath, wfInfo); urlToReturn = webFileInfo.Path; } return(urlToReturn); }
public string SaveImageToCloud(string imagePath, string imageName) { String urlToReturn = null; var client = new SkyDriveServiceClient(); client.LogOn("*****@*****.**", "Y)rm91234"); WebFolderInfo wfInfo = new WebFolderInfo(); WebFolderInfo[] wfInfoArray = client.ListRootWebFolders(); wfInfo = wfInfoArray[0]; client.Timeout = 1000000000; //string fn = @"test.txt"; if (File.Exists(imagePath)) { var webFileInfo = client.UploadWebFile(imagePath, wfInfo); urlToReturn = webFileInfo.Path; } return(urlToReturn); }