What is Drumz0r?
Drumz0r is an XNA Application that shows how to control a system using the Harmonix Drumkit provided with Rockband.
Read the rest of this entry »
What is Drumz0r?
Drumz0r is an XNA Application that shows how to control a system using the Harmonix Drumkit provided with Rockband.
Read the rest of this entry »
11
Ok, personally I was using a textbox and when you pressed “Enter” it would complete a task, BUT I also wanted the textbox to be autocompletive (if that’s a valid term).
When I actually went to test it all out I found that instead of running the Keypress event, it just highlighted the text and did nothing else… Googled to find there is no valid reason why, but there is a work around, and it’s simple.
Abandon KeyPress and use the KeyDown function, setup your keydown event correctly, and it will work.
28
When you just want to open a webpage in the systems default browser there are many complicated methods to do it, like going through the registry and finding out what the default browser is… blah blah…
SO! Why not just hand the task over to windows…
And there you go, windows will handle the url as if you had just clicked a shortcut on the desktop and open it with the default browser.
Easy.
31
If you’re looking for an easy way to communicate through ssh without paying rediculous prices for components, then read on.
Behold: SharpSSH (Download). It is a free communications component that is great for ssh.
Add the binary dll’s as a reference to your project.
The usage is surprisingly simple.
Tamir.SharpSsh.SshStream ssh = new Tamir.SharpSsh.SshStream(serverip, username, password);
The server ip does not need a port, it uses standard port 22.
string command = “killall -u username”; // could be any command
ssh.Write(command);
ssh.ReadResponse();
and when you are done…
ssh.Close();
To overcome issues with root password prompting you must set the server so that a username does not require a password.
26
For some reason, the Visual Studio debugger suppresses this automatically, but the release does not.
It has something to do with DRM signatures, anyway the fix is to open up the entry point in the application (program.cs) and make these changes…
namespace Program
{
[Flags]
public enum ErrorModes : uint
{
SYSTEM_DEFAULT = 0×0,
SEM_FAILCRITICALERRORS = 0×0001,
SEM_NOALIGNMENTFAULTEXCEPT = 0×0004,
SEM_NOGPFAULTERRORBOX = 0×0002,
SEM_NOOPENFILEERRORBOX = 0×8000
}
static class Program
{
// Suppresses “Bad Image” error.
[DllImport("kernel32.dll")]
static extern ErrorModes SetErrorMode(ErrorModes uMode);
[DllImport("kernel32.dll")]
static extern ErrorModes GetErrorMode();
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] Args)
{
SetErrorMode(ErrorModes.SEM_FAILCRITICALERRORS);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1(Args));
}
}
}
12
Apparently this proved a challenge for google, so I converted and simplified some PHP code I found.
This method will turn any byte into a human readable string, handy when dealing with files.