1171
Dota Allstar / Re: Dota Wo
« เมื่อ: กุมภาพันธ์ 22, 2012, 04:21:02 pm »V.81
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Function GenerateHash(ByVal strToHash As String) As String
Dim md5Obj As New Security.Cryptography.MD5CryptoServiceProvider
Dim bytesToHash() As Byte = System.Text.Encoding.ASCII.GetBytes(strToHash)
bytesToHash = md5Obj.ComputeHash(bytesToHash)
Dim strResult As String = ""
For Each b As Byte In bytesToHash
strResult += b.ToString("x2")
Next
Return strResult
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox2.Text = GenerateHash(TextBox1.Text) 'Output = MD5Hash(Input)
End Sub
End Class
// Show the menu here, according to the menu sub template.
template_menu();
include_once('banner1.txt');
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
include_once('banner2.txt');
#!/usr/bin/env perl
# Thai ID Number Random original code by AssazziN THD
# Port to Linux by Ron Linix
use Tk;
### ID rand func
sub makeTSSN {
$id[0]=int(rand(8))+1;
$last=$id[0];
foreach $z (2..12) {
$id[$z-1]=int(rand(9));
$tmp[$z-1]=$id[$z-1]*(14-$z);
$last+=$tmp[$z-1];
}
$last=11-($last%11);
if ($last==11) {
$last=1;
}
elsif ($last==10) {
$last=0;
}
$key=join('',@id);
$key.=$last;
#return $key;
return "$id[0]-$id[1]$id[2]$id[3]$id[4]-$id[5]$id[6]$id[7]$id[8]$id[9]-$id[10]$id[11]-$last";
}
### GUI
my $id;
my $mw = new MainWindow();
$mw->title("Thai ID Random.");
$mw->Label( -text => 'Thai ID Gen : Linux port by Ron Linix Original from AssazziN THD')->pack;
$entry = $mw->Entry( -textvariable => \$id )->pack;
$mw->Button( -text => 'Generate',
-command => sub{ $id = &makeTSSN, print $id,"\n",} )->pack;
MainLoop;
[/mb]