Jul
23
2009
A colleague came to me today asking if I knew of any way to remove the close button from a windows form, but still show the minimize and maximize buttons.
On the face of it, it sounded like an easy answer. I knew you could disable both the minimize and maximize buttons very easily from within the Visual Studio GUI – so surely there’s an option for the third button; the close button?
Actually, no. Whilst you can remove all three buttons in one go (changing the setting “ControlBox” to false.) and as previously mentioned, you can disable the maximize and minimize buttons (“MaximizeBox” and “MinimizeBox” settings respectively), there is no setting to directly control the Close button.
Continue reading
no comments | tags: C#, Tricks, Visual Studio | posted in C#, Computers
Jul
14
2009
According to an article on the BBC tech news website, it is possible to determine individual pc keystrokes by monitoring power fluctuations in your mains supply.
According to the article, the six wires that make up PS2 cables are usually very tightly packed together and poorly shielded, leading to “leaking” of information from the data wire, onto the ground wire.
The current on this ground wire eventually flows, via the motherboard and then the PSU, makes it way through the power cable and out into your mains ring.
Because the clock speed of keyboards is much lower than anything else used within a PC, it’s relatively easy to then filter out the other “background noises” also flowing along the ground circuit, until you’re left with just the key presses, which can the be easily read on an oscilloscope.
Then, because the data is sent one bit at a time, it’s simply a case of joining the bits and calculating back to the original key.
Whilst this is quite cool, the pair who have been researching this type of “snooping” have so far only proved it works up to a distance of 15 metres, and also requires the keyboard to be PS2, I think the discovery has come a little too late…
Original article: BBC News – Technology
2 comments | tags: BBC, PS2, Snooping | posted in Computers
Jul
10
2009
I had to make a slight change to one of my applications for a customer today, making it check if it is already running on the local machine and, if it is, abandon it’s attempt to start up another instance.
My initial thoughts were to examine the executing processes and check for the existence of the application in the list:
1
2
3
4
5
6
7
8
| string procName = Process.GetCurrentProcess().ProcessName;
Process[] processes= Process.GetProcessesByName(procName);
if (processes.Length == 1)
{
//run application
...
} |
Now, whilst this works, it is easily “beatable” by simply changing the executable’s name. Doing so will cause the method “GetProcessessByName()” to return only a single match, instead of the current application and any other duplicate instances.
Continue reading
no comments | tags: C#, Mutex, Threading, Tricks | posted in C#, Computers
Jul
2
2009
I stumbled across what appears to be an excellent program / plugin; VS.php
It allows for the development, debugging and testing of php files within Visual Studio 2008!
Although it doesn’t have a visual designer, which might scare some people off, I’m a firm believer that visual web “designers” are a bad thing anyway
What it does have is an in-built version of Apache webserver, which takes away the pain of configuring Apache on your local machine to test your sites.
It also supports IIS 6 & 7 with FastCGI.
One of the newest features is the direct support for developing Silverlight 3 applications alongside your php scripts. This means you can have one project that contains both php and Silverlight 3 source files.
On top of that, it also has full intellisense built in!
The only downside is that this cool application isn’t free, but at only $99 and with a 30-day free trial, it’s not a huge expense and would probably be a great buy for anyone who uses Visual Studio a lot, but also writes scripts in PHP.
Check it out here: http://www.jcxsoftware.com/vs.php
no comments | tags: PHP, Visual Studio | posted in Computers, PHP
Jun
29
2009
A SSIS package I wrote for a customer has all of a sudden stopped working correctly. Whilst no errors are raised, and the job completes successfully, it appears to “stop” on the very first task.
As the server the package is running on already had Visual Studio with “BITS” installed, I thought I’d just open the dtsx file up, hit debug and trace through it.
Imagine my surprise when, after opening the package, I found the “debug” options all greyed out!
After a bit of mucking around, I discovered that although you can debug a dtsx package, it first needs to be opened as part of a project, rather than directly as in my case. So, after creating a new project and simply adding in the dtsx package, I’m able to step through line by line..
Although it’s nothing major, it just seems a bit long winded.
What I’d also like to see is the ability to open packages that are already imported into SQL Server and then step through them immediately – that’d be cool
1 comment | posted in Computers, SQL Server
Jun
16
2009
Whilst working on a work project, I needed to create a HTML table that would contain possibly hundreds of rows. The table was followed by a set of buttons that were required to remain on screen at all times (for a set resolution).
So I knew I needed to make the table scrollable, which isn’t exactly a hard task.
However, the top row of the table contained the column headers, which also needed to remain on screen at all times.
Achieving this is a very simple task in tools such as Microsoft Excel, but it wasn’t so straight forward for the web.
After playing around with several examples, all with varying degrees of success, I managed to piece it all together into a final version, which works on IE v6, v7 & v8, as well as Firefox v2 & v3 and even Opera!
(Oh, and it’s XHTML and CSS3 compliant too!)
Continue reading
2 comments | tags: CSS, HTML, Table, Web | posted in Web
Jun
12
2009
Anyone who has seen code written by me that requires the invoking of WinForm controls will know that I have an irrational hatred of the “recommended” way of resolving cross-thread operations.
Now, whilst I agree that cross-thread operations should be handled correctly, and I’m actually glad Microsoft decided to tighten its belt over this when it came to creating the dotNet framework, it just seems very “bloaty” to have to write methods such as the following:
Continue reading
2 comments | tags: C#, extension methods, invoke, lambda | posted in C#
Jun
10
2009
I had the pleasure of upgrading the OS on our sales director’s new notebook today.
(It was shipped with XP Home, which is useless for business work.)
After discovering that the “USB CD-ROM drive” we apparently had in the store-room was infact firewire, and as such totally useless for my purposes, I had to find another way of getting XP Pro installed.
From experience, I know you can run many flavours of Linux straight from a USB memory stick, as long as the computer’s BIOS natively supports USB flash disks. But I’ve never seen or tried to do the same with Windows XP.
After a morning’s worth of trying different ideas and different memory sticks, I was finally greeted by the warm blue installation screen of the Windows XP operating system.
Below is a quick step guide of how I achieved it:
Continue reading
3 comments | tags: BartPE, Boot, USB, Windows XP | posted in Computers