Artem's blog

Mainly .NET (C#, ASP.NET) and my projects

Software Protector as a single project

Recently, a part of SKGL API (http://skgl.codeplex.com/), called Software Protector was promoted, and now you might find the new versions of it easily at http://softwareprotector.codeplex.com/.

Visual Basic – Language Syntax

This is my current presentation about Visual Basic that summarizes information from http://msdn.microsoft.com/en-us/library/ms172579.aspx.

Visual Basic Tutorial (download as .ppt)

Please notice that you might find other presentations at learning.clizware.net

Software Protector + SKGL 2.0

Today, it is an important event – release of SKGL library, and also a well-working GUI – Software Protector.

Before, when SKGL was hosted at CliZ Ware, even though the library was free of charge, the source of it was closed by the license. Now, however, the newer versions of SKGL will have an open source, so that you can learn, and maybe, write your own Serial Key Algorithm in future, much more improved and securer.

In order to download the library, enter a link below:

 

Storing Information inside a Key with SKGL API

Encrypting a Key with SKGL API

Installer build into Windows

IExpress is an easy to use, free of charge, build in to Windows setup system. It consist of an easy wizard, which is also a big help to all new software developers. In order to call the program, type iexpress.exe in Run.

This is the first screen of the installer. You can either choose an existing SED file, which is basically a plaint text, or you can create a new SED file with the easy wizard.

Later on, you will be able to chose from different kinds of setups.Ether you create a setup project with an installation command, extract files only, or a CAB file that might be used by other applications.

Eventually, you will be able to specify what to display on the target machine, which files that are to be extracted, a licence agreement, dialog boxes, and more.

An advantage with IExpress is certainly the ability to use it right away – it is already installed in Windows. It is also easy-to-use and it outputs an EXE file. The output executable is also easy to follow, easy to install. Finally, it is free of charge!

A collapse-able menu

This tutorial will show you how to create a menu that can be opened and collapsed. First of all, you need to include a certain script that will do the entire thing.

// JScript source code

function showHide(objId) {
    var obj = document.getElementById(objId).style.display;

    if (obj == "inline") {
        hideObj(objId)
    }
    else {
        showObj(objId);
    }
}

function showObj(objId) {
    document.getElementById(objId).style.display = "inline";
}
function hideObj(objId) {
    document.getElementById(objId).style.display = "none";
}

Basically, it checks whether the object is collapsed or opened, and then does the oppsite; it collapses if it is open, and opens if it is collapsed. You might already now use the code above. By making a for example link (“a”), it will show and hide everytime you press it.

<a href="#" onClick="showHide('toShowOrHide');">Press to show or hide</a><br />
<div id="toShowOrHide" style="display:none">
It seems that it works!
</div>

We have a link that executes a command showHide with an argument toShowOrHide, which is, as you might see, the ID of the div. By entering the link, you will either open or collapse the div object. Remember, you might also use other tags/elements that are to be showed or hided. To see this code in work, go to http://editor.clizware.net/?id=8

Get Hash Code with Java Script

Once, I wrote about hash function that I improved. Though, that was C#. In this post I will show you how to get hash code with Java Script. (previous post)

function getStableHash(input,hashLength)
{
	/* Copyright (C) 2012 Artem Los,
	 * All rights reserved.
	 *
	 * code based on:
	 * http://blog.clizware.net/news/631
	 *
	 * originaly from: http://stackoverflow.com/questions/548158/fixed-length-numeric-hash-code-from-variable-length-string-in-c-sharp
	 */	

	 var _length = Math.pow(10,hashLength); //result in 10 numbers, if hashLength is 10
	 var hash = 0;

	 for (var j = 0; j < input.length; j++)
	 {
		 hash += input.charCodeAt(j);
		 hash += (hash << 10);
		 hash ^= (hash >> 6);
	 }

	 hash += (hash << 3);
	 hash ^= (hash >> 11);
	 hash += (hash << 15);

	 var result = ((hash % _length) + _length) % _length;//hash.mod(_length)

	 var check = parseInt(_length / result);
	 if (check > 1)
	 {
		 result *= check;
	 }

	 return result;
}

In order to calculate a hash value, you need to define two main variables. First of all, the string to calculate hash from (input), and eventually, the length of the result (hashLength). It is recommended that you set the hashLength to 8 or in some cases 10.

Please take a look at this code in work http://editor.clizware.net/?id=9

Create and Validate a Key with SKGL

SKGL is now released!

SKGL – Software licensing system is now released! The page is currently hosted at http://skgl.clizware.net/