从XNA中的多个键盘获取输入(Getting input from multiple keyboards in XNA)
我正在寻找xna中键盘输入的文档,我注意到一些有趣的东西:它接受一个
PlayerIndex
参数,就像xbox控制器一样。我的问题是:因此可以使用
PlayerIndex.One
,Two
,Three
等同时从多个键盘获取输入吗?I was looking at documentation for keyboard input in xna and I noticed something interesting: it accepts a
PlayerIndex
argument, like xbox controllers.My question is: is it therefore possible to get input from multiple keyboards at the same time using
PlayerIndex.One
,Two
,Three
, etc?
原文:https://stackoverflow.com/questions/19751483
更新时间:2022-01-28 07:01
最满意答案
我能够通过找到获取文件信息的另一种方法来解决问题。
string Name = ""; HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(Link); HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse(); for(int i=0; i < myHttpWebResponse.Headers.Count; i++) { if (myHttpWebResponse.Headers.Keys[i] == "Content-Disposition") { Name = myHttpWebResponse.Headers[i]; } } myHttpWebResponse.Close();
I was able to fix the problem by finding another way to get the files info.
string Name = ""; HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(Link); HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse(); for(int i=0; i < myHttpWebResponse.Headers.Count; i++) { if (myHttpWebResponse.Headers.Keys[i] == "Content-Disposition") { Name = myHttpWebResponse.Headers[i]; } } myHttpWebResponse.Close();
相关问答
更多-
DownloadFileAsync在后台下载文件,您的应用程序可能会在下载完成之前终止。 您应该等待DownloadFileCompleted事件,或使用将等待文件下载的DownloadFile方法。 Thank you everyone for trying to help, I really appreciate it. I realize that the problem was actually me not concatenating the url correctly. Right, a stu ...
-
尝试WebClient.DownloadFileAsync() 。 您可以使用自己的超时定时器调用CancelAsync() 。 Try WebClient.DownloadFileAsync(). You can call CancelAsync() by timer with your own timeout.
-
您正在从目标路径创建目录。 改变这一行 System.IO.Directory.CreateDirectory(targetPath); 至 System.IO.Directory.CreateDirectory(new System.IO.FileInfo(targetPath).DirectoryName)); You are creating the directory from the target path. Change this line System.IO.Directory.Creat ...
-
首先,您需要确定这不仅发生在WebClient.DownloadFile而且发生在其他程序中,通过编写一个可能会打印出时间的快速程序来完成此操作。 接下来的事情会是你的代码重新激活到活动窗口,导致它停止? 当电脑被锁定时,没有活动窗口。 当计算机被锁定导致WebClient停止处理时(也许是网络策略或某事),另一种情况可能是您的某项服务禁用。 我希望这有帮助。 Firstly you need to establish if this happens with not only WebClient.Down ...
-
我能够通过找到获取文件信息的另一种方法来解决问题。 string Name = ""; HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(Link); HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse(); for(int i=0; i < myHttpWebResponse.Headers.Count; i ...
-
在BackgroundWorker中取消Webclient.DownloadFile(Cancel a Webclient.DownloadFile within a BackgroundWorker)[2023-06-24]
如果你正在使用System.Net.WebClient ,它包含一个CancelAsync()方法,它应该为你做。 您需要的只是对要取消的特定WebClient的引用,以便按钮的单击事件可以调用该方法。 请注意,我自己没有测试过 - 但这是我尝试的第一件事。 If you're using System.Net.WebClient, it contains a CancelAsync() method which should do it for you. All you should need is a ... -
Parallel.ForEach中的WebClient.DownloadFile()(WebClient.DownloadFile() within Parallel.ForEach)[2022-02-16]
你在第二种情况下关闭循环变量 - 试试这个: foreach (Photo p in photos) { Photo photo = p; Task.Factory.StartNew(() => { WebClient webClient = new WebClient(); webClient.DownloadFile(photo. ... -
Powershell WebClient.DownloadFile不会覆盖(Powershell WebClient.DownloadFile not overwriting)[2023-10-15]
$mailMessage保持文件的打开句柄。 加 $mailMessage.Dispose() 在脚本的末尾,你应该能够覆盖。 $mailMessage is keeping an open handle to your file. Add $mailMessage.Dispose() at the end of the script and you should be able to overwrite. -
什么样的格式丢失了? 听起来你可能只是获得Unix模式(\ n)文本,然后在DOS模式(\ r \ n)编辑器中打开它。 一个快速的regexprep(sid, '\r?\n', sprintf('\r\n'))将解决这个问题。 切换到DownloadFile可能不会。 至于你得到的“没有这样的方法”错误, WebClient.DownloadFile有一个void返回类型。 看起来Matlab的.NET支持认为是签名的一部分。 删除“data =”赋值,它就会消失。 >> client = System. ...
-
嗯,我想这是由于授权限制 。 您的代码, Carlos和我自己获得4K文件的原因是因为我们无权访问所请求的文件。 我猜您已经使用某种登录程序通过浏览器访问该站点,或者是在可信网络上,允许该站点使用您的NT令牌。 似乎证实这一假设的是,当我将GetBinary.aspx文件的扩展名更改为jpeg时,我获得了一种“禁止”图标。 因此,您可能需要从代码中进行更多工作才能进行身份验证 。 编辑:使用Cygwin的'NIX 文件实用程序给出: JPEG image data, JFIF standard 1.01 ...