Torna al Thread

public static bool salvaVideo(tipoYouTubeVideo video, out List<string> msg_error) { msg_error = null; string filename = video.Upload.FileName; string FileType = video.Upload.ContentType; string videoname = Utility.PERCORSO_FISICO(VIDEO_TEMP_FOLDER + video.Codice + "_" + filename); video.Upload.SaveAs(videoname); YouTubeRequestSettings settings = new YouTubeRequestSettings(Costanti.APPLICAZIONE, DeveloperKey, Username, Password); YouTubeRequest request = new YouTubeRequest(settings); Video newVideo = new Video(); newVideo.Title = video.Title; newVideo.Tags.Add(new MediaCategory(video.Category, YouTubeNameTable.CategorySchema)); newVideo.Keywords = video.Keywords; newVideo.Description = video.Description; newVideo.YouTubeEntry.Private = true; newVideo.Tags.Add(new MediaCategory(video.DeveloperTag, YouTubeNameTable.DeveloperTagSchema)); newVideo.YouTubeEntry.setYouTubeExtension("location", "Bari, BA"); newVideo.YouTubeEntry.MediaSource = new MediaFileSource(videoname, FileType); Video createdVideo = request.Upload(newVideo); return true; }
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5