我正在用HTML5和Javascript制作游戏.
我怎么能通过Javascript播放游戏音频?
当我去创建一个新项目时,"Windows服务"模板不存在!
有人可以请告诉我在哪里可以获得它,或提供下载链接吗?
我需要在某个区域内写出不同的文本段落.例如,我在控制台上绘制了一个如下所示的框:
/----------------------\
| |
| |
| |
| |
\----------------------/
Run Code Online (Sandbox Code Playgroud)
我如何在其中写入文本,但如果它太长则将其包装到下一行?
我正在编写一个简单的键盘记录程序(用于非恶意目的).
注意:这是使用.net 4.0 Client Profile
每当我启动程序时,我都会收到此错误:
The process cannot access the file 'C:\Users\.. ..\bin\Debug\log.log' because it is being used by another process.
Run Code Online (Sandbox Code Playgroud)
这是我的主要代码:
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;
using System.IO;
using System.Text;
namespace Logger
{
public partial class MainForm : Form
{
public string cWin = null;
public static string nl = Environment.NewLine;
public MainForm()
{
InitializeComponent();
}
public static DialogResult AskOverwrite()
{
DialogResult result = MessageBox.Show("Log already exists. Overwrite?",
"Overwrite?",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);
return …Run Code Online (Sandbox Code Playgroud) 我正在编写一个C#应用程序,需要在控制台关闭时上传文件(通过X按钮,或者计算机关闭).
我怎么能这样做?
AppDomain.CurrentDomain.ProcessExit += new EventHandler (OnExit);
Run Code Online (Sandbox Code Playgroud)
仅在我exit向控制台发出命令时运行,而不是在我按下红色关闭按钮时运行.
请仅在解决方案通过X按钮关闭控制台时运行解决方案,并且当计算机关闭时(通常通过Windows,我知道如果电源被拉到xD则不能).
我正在学习C#,但事实上它需要和带编译器的IDE会让事情变得更加困难.我可以访问的主计算机是我的学校计算机,我没有管理员权限.有没有办法在不需要管理员权限的情况下将C#IDE /编译器放在那里?
请记住,我希望能够在家中使用VS C#2010进行开发,并将项目带到我的学校计算机上.
我在C#中进行文本冒险,有人建议我使用调度表而不是switch语句.
这是switch语句代码:
#region Public Methods
public static void Do(string aString)
{
if(aString == "")
return;
string verb = "";
string noun = "";
if (aString.IndexOf(" ") > 0)
{
string[] temp = aString.Split(new char[] {' '}, 2);
verb = temp[0].ToLower();
noun = temp[1].ToLower();
}
else
{
verb = aString.ToLower();
}
switch(Program.GameState)
{
case Program.GameStates.Playing:
if (IsValidInput(Commands, verb, true))
{
switch(verb) //this is the switch statement
{
case "help":
case "?":
WriteCommands();
break;
case "exit": …Run Code Online (Sandbox Code Playgroud) 有没有人知道如何在HTML5画布上顺序执行以下操作(使用javascript).
我觉得这很难做的原因是因为无法在脚本中创建暂停.任何帮助将不胜感激!
在我的应用程序中,我在我的MainForm类中调用了一个启动方法OnStart,该方法定义如下:
public void OnStart()
{
//code
}
Run Code Online (Sandbox Code Playgroud)
当我从Main方法中调用它时,它不会运行.我究竟做错了什么?(哦,和OnStop方法一样.)
这是我的Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace Logger
{
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
MainForm mainForm = new MainForm();
Application.Run(mainForm);
AppDomain.CurrentDomain.ProcessExit += new EventHandler (mainForm.OnStop);
mainForm.OnStart();
}
}
}
Run Code Online (Sandbox Code Playgroud) 整晚都在敲打我的脑袋.我想要做的就是有一个内容控件,可以根据ViewModel中的布尔值在显示两个不同的按钮之间切换.
基本上我有一个任务在后台运行,带有取消按钮.一旦你点击取消并且任务停止,取消按钮应该变为后退按钮.这是两个单独的按钮元素,而不仅仅是更改单个按钮的属性.我正在使用MahApps TransitioningContentControl,所以我希望能够使用转换.
如果这大部分可以在XAML中完成,我会很惊讶.我真的不想为一个简单的东西添加一堆样板代码.
编辑:这是代码片段.没有太多因为我刚刚删除了所有无效的内容.
<Controls:TransitioningContentControl x:Name="CancelBackButtonControl" HorizontalAlignment="Left" VerticalAlignment="Top" Width="80" Height="80">
<Canvas>
<Button x:Name="CancelButton" HorizontalAlignment="Left" VerticalAlignment="Top" Width="80" Style="{DynamicResource MetroCircleButtonStyle}" Height="80" IsCancel="True" Content="{StaticResource appbar_close}" BorderBrush="Black" Command="{Binding CancelCommand}"/>
<Button x:Name="GoBackButton" HorizontalAlignment="Left" VerticalAlignment="Top" Width="80" Style="{DynamicResource MetroCircleButtonStyle}" Height="80" IsCancel="True" Content="{StaticResource appbar_arrow_left}" BorderBrush="Black" Command="{Binding GoBackCommand}"/>
</Canvas>
</Controls:TransitioningContentControl>
Run Code Online (Sandbox Code Playgroud) c# ×8
html5 ×2
javascript ×2
sharpdevelop ×2
.net-4.0 ×1
adventure ×1
canvas ×1
file-io ×1
html5-audio ×1
ide ×1
portability ×1
wpf ×1