Windows 8 Release Date Announced
Microsoft has announced that the retail version of Windows 8 will be available to the public on 26 October 2012.
If you want to try Windows 8 before buying it you can always install the release preview which can be found here for free.
UPNP port forwarding – The easy way
From my experience I noticed that the NATUPnP library is pretty unstable when it comes down to UPNP (mostly refusing to work on some routers regarding if the router is UPNP enabled or not) I decided to make a simple walk-through to help people resolve these kind of issues and aid them in creating a program that manual port forwarding is not needed, at least for UPNP enabled routers.
So, let’s get started. First you need to download the Mono.Nat library which can be found here. When the download is complete extract the contents of the .zip file anywhere you like.
In order to be able to take advantage of the library we need to locate the file we have extracted and add it as a reference to our project then import it in your project using
1 | using Mono.Nat; |
Now it’s time for some coding.
NetBeans invalid jdkhome specified fix
If you use NetBeans as an IDE then you probably came across the following error, "Cannot locate java installation in specified jdkhome"
.
This usually happens after you uninstall the java jdk which you used to use (usually happens after you update java).
There’s is an easy way to fix this. Navigate to your NetBeans installation folder which by default should be C:\Program Files\NetBeans and look for the folder etc. Inside that folder should be a file with the name netbeans.conf. What you need to do is to open the file with your favorite text reader (notepad as an example) and look for the line that starts with netbeans_jdkhome=.
You simply need to modify the line in order to point Netbeans to the the location of the java jdk version you are currently have installed. It should look something like this netbeans_jdkhome=”C:\Program Files\Java\jdk1.7.0_05″. If you are unsure what version you have installed navigate to your java’s installation folder (the default path is C:\Program Files\Java) and look for folder there.
If you are having issues editing the file because of UAC and the lack of administration rights and you are unsure on how to resolve that, read How to edit a file in Program Files. That should hopefully help you out.
Make sure to save the file after you are done editing it. Fire up NetBeans, the error should be gone.
Happy coding!
Posted in Software Tips.
How to encrypt and decrypt files in C#
The following snippets will allow you to encrypt and decrypt files in C#.
Needless to say there are numerous methods that this can be achieved but for the reasons I will explain at the end I came about using this one in my projects.
Also keep in mind that assuming you want to implement something like this in your project you should extend the error catching to detect invalid key lengths, file locations and so on.
Posted in C#.
Tagged aes, C#, cryptography, csharp, decrypt file, encrypt file, RijndaelManaged, snippet, winforms