Archive for the ‘VB.NET’ Tag
Fairplay : Soccer Management Software
Hi Folks,
Just finished a big school project, for our end of terms exam….
The FAIRPLAY Management soccer software, cool name úH!
I’am proud of it, well only a little…. It’s just Visual Basic programming, Ok, it’s not that braincracking, but i must say, it wasn’t always that easy to…
Follow through to see what i made….
Assignment: Creating a software program to manage the Belgian Soccer League, but our programm had to be more than this….
What’s more?
A lot more… Trust me….
The managing software had te be able to delete, add, edit and transfer soccer players and also edit , add and delete soccer teams, ….
For each player there had to be a possibility to add there scores, on the different days of playing…
The ability to make your own virtual soccer team was also implemented….
The admin of our programm, is than able to make new virtual teams and assign different players of the excisting soccer teams to them….
A score system had to be made for all the virtual teams… Deppending on the real life scores of the different players in the actual socces team,we made a global high score of all the virtual teams…. (with different vieuw of the scores)
General settings enable the admin to change all day settings, like: adding , editing, deleting playdays, city’s, seasons, …
A external exchange between MS Office is also available,this for loading and writing team players to an Excel file …
An external exchange between MS Word makes it possible to make a formated list of all the contestants with there according virtual teams, and a list of all the virtual teams with there players…
This was a very good learning project, but it took a lot of work…
There are many more options in my software programm, as i have not mentioned a back-up system to a external FTP (also an internal back-up is available), a Triple DES pasword saver and a help file …
Screenshots :






Project assignement (Dutch Version) & Software Information (Dutch Version)
Encrypt/Decrypt with Imports System.Security.Cryptography
This little tutorial puts some morge sunshine on the System.Security.Cryptography standard class in VB.net…
There are a few encryption possibilities, but i’m going to encrypt/decrypt on a TripleDes algorithm!
More info on the TripleDES: http://en.wikipedia.org/wiki/Triple_DES
The first thing we have to do is import the class
Imports System.Security.Cryptography
We also make a global (module) variable, for a Service Provider to handle the TripleDES settlement
Private TripleDes As New TripleDESCryptoServiceProvider
We then need 2 functions, A decrypt and Encrypt function…
We’ll start with the Encrypt function…
Public Function EncryptData(ByVal plaintext As String) As String
‘ Convert the plaintext string to a byte array.
Dim plaintextBytes() As Byte = System.Text.Encoding.Unicode.GetBytes(plaintext)
‘ Create the stream.
Dim ms As New System.IO.MemoryStream
‘ Create the encoder to write to the stream.
Dim encStream As New CryptoStream(ms,TripleDes.CreateEncryptor(),System.Security.Cryptography.CryptoStreamMode.Write)
‘ Use the crypto stream to write the byte array to the stream.
encStream.Write(plaintextBytes, 0, plaintextBytes.Length)
encStream.FlushFinalBlock()
‘ Convert the encrypted stream to a printable string.
Return Convert.ToBase64String(ms.ToArray)
End Function
To decrypt the following Encryption we will make the function beneath…
Public Function DecryptData(ByVal encryptedtext As String) As String
‘ Convert the encrypted text string to a byte array.
Dim encryptedBytes() As Byte = Convert.FromBase64String(encryptedtext)
‘ Create the stream.
Dim ms As New System.IO.MemoryStream
‘ Create the decoder to write to the stream.
Dim decStream As New CryptoStream(ms, TripleDes.CreateDecryptor(), System.Security.Cryptography.CryptoStreamMode.Write)
‘ Use the crypto stream to write the byte array to the stream.
decStream.Write(encryptedBytes, 0, encryptedBytes.Length)
decStream.FlushFinalBlock()
‘ Convert the plaintext stream to a string.
Return System.Text.Encoding.Unicode.GetString(ms.ToArray)
End Function
This will do the trick!
You can also attach your personal Private / Personal key to the TripleDES Cryprography, here VB uses the standard Keys …
What you will have to do is following,
1. Declare your own private and public key ( wich are an array of bytes)
Dim key() As Byte = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}
Dim iv() As Byte = {8, 7, 6, 5, 4, 3, 2, 1}
2. edit the line of EncryptData and DecryptData where you attach your own declared keys
Dim decStream As New CryptoStream(ms, TripleDes.CreateDecryptor(key, iv),_ System.Security.Cryptography.CryptoStreamMode.Write)
Comments (1)
Leave a Comment