我正在使用代码来模拟用户帐户以访问文件共享.
public class Impersonator :
IDisposable
{
#region Public methods.
// ------------------------------------------------------------------
/// <summary>
/// Constructor. Starts the impersonation with the given credentials.
/// Please note that the account that instantiates the Impersonator class
/// needs to have the 'Act as part of operating system' privilege set.
/// </summary>
/// <param name="userName">The name of the user to act as.</param>
/// <param name="domainName">The domain name of the user to act as.</param>
/// <param name="password">The password of the user to act as.</param> …Run Code Online (Sandbox Code Playgroud) 每当我尝试使用YouTube API通过直接上传来上传大型视频时.我得到一个OutOfMemory异常.有什么办法可以摆脱这个吗?YouTube API没有说明使用直接上传的视频大小限制.
我放弃了直接上传.现在我尝试了可恢复的上传方式.我的代码如下.
YouTubeRequest request;
YouTubeRequestSettings settings = new YouTubeRequestSettings("YouTube Upload", Client Key, "Username", "Password");
request = new YouTubeRequest(settings);
Video newVideo = new Video();
ResumableUploader m_ResumableUploader = null;
Authenticator YouTubeAuthenticator;
m_ResumableUploader = new ResumableUploader(256); //chunksize 256 kilobyte
m_ResumableUploader.AsyncOperationCompleted += new AsyncOperationCompletedEventHandler(m_ResumableUploader_AsyncOperationCompleted);
m_ResumableUploader.AsyncOperationProgress += new AsyncOperationProgressEventHandler(m_ResumableUploader_AsyncOperationProgress);
YouTubeAuthenticator = new ClientLoginAuthenticator("YouTubeUploader", ServiceNames.YouTube, "kjohnson@resoluteinnovations.com", "password");
//AtomLink link = new AtomLink("http://uploads.gdata.youtube.com/resumable/feeds/api/users/uploads");
//link.Rel = ResumableUploader.CreateMediaRelation;
//newVideo.YouTubeEntry.Links.Add(link);
System.IO.FileStream stream = new System.IO.FileStream(filePath, System.IO.FileMode.Open, System.IO.FileAccess.Read);
byte[] chunk = new byte[256000];int count = 1;
while (true) { …Run Code Online (Sandbox Code Playgroud) 我想把我的iPhone应用程序放在测试设备上.我读到了需要开发人员证书的地方.我是否需要参与付费开发人员计划才能创建开发人员证书和配置文件?
我做任何编码已经有6个月了.技术的生命.铅.快速问题 - 我可以使用EF 4和MVC 2吗?或者我是否必须升级到MVC 3?