Results 1 to 2 of 2

Thread: help on visual basic 2008

  1. #1
    Join Date
    Mar 2011
    Posts
    1

    help on visual basic 2008

    I need to create a project that will encrypt and decrypt the alphabet. if there is a space or unknown character the program should just leave it like that or blank .

    "a" = 0
    "b" = 1
    "c"= 2 ...

    "z" = 25
    if the sum is greater than 26 then continues to
    "a" = 26
    "b" = 27
    "c" = 28

    I have tried to do it but it's not working my teacher said that we could use the Mod i don't know how to use
    Please help


    Option Explicit On
    Option Strict On
    Option Infer Off

    Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChangeButton.Click

    Dim plainlist As String
    Dim key As String
    Dim firstnumb As String
    Dim secnum As String
    Dim encryptedms As String
    Dim newvalue As Integer
    Dim alphavalue2 As Integer
    Dim alphabet As String = "abcdefghijklmnopqrstuvwxyz"
    Dim alphaValue As Integer
    Dim counter As Integer = 0
    Dim counter2 As Integer = 0



    plainlist = plainTextBox.Text
    key = keyTextBox.Text

    counter = 0
    counter2 = 0


    Do While counter < plainlist.Length


    firstnumb = plainlist.Substring(counter, 1)
    alphaValue = alphabet.IndexOf(firstnumb)
    MessageBox.Show(CStr(alphaValue))

    secnum = key.Substring(counter2, 1)
    alphavalue2 = alphabet.IndexOf(secnum)
    MessageBox.Show(CStr(alphavalue2))



    newvalue = alphabet.IndexOf(firstnumb) + alphabet.IndexOf(secnum)

    MessageBox.Show(CStr(newvalue))


    If alphaValue = -1 Then
    encryptedms = firstnumb


    End If

    If alphaValue > 25 Then

    alphaValue = alphaValue - 26

    End If



    If alphaValue = -1 Then

    encryptedms = plainlist.Substring(counter, 1)

    Else


    encryptedms = alphabet.Substring(newvalue, 1)

    End If

    counter = counter + 1
    counter2 = counter2 + 1


    encryptLabel.Text = encryptLabel.Text & encryptedms

    Loop

  2. #2
    Join Date
    Dec 2007
    Posts
    2,291

    Re: help on visual basic 2008

    There is a microsoft article that describes how to use the cryptography classes that are provided by the Microsoft .NET Framework. You can use the cryptography classes to encrypt a text file to an unreadable state. Then, you can decrypt that text file back to its original format. For more information you can check this website.

Similar Threads

  1. How to use Visual Basic 2008 Express with Windows 7
    By Breath in forum Software Development
    Replies: 5
    Last Post: 28-01-2010, 04:34 PM
  2. Form Help in MS Visual Basic 2008!
    By NGV BalaKrishna in forum Software Development
    Replies: 5
    Last Post: 21-01-2010, 10:07 PM
  3. Save button code in visual basic 2008
    By Chrisch in forum Software Development
    Replies: 4
    Last Post: 23-08-2009, 01:20 AM
  4. Error Code 1330 while installing Visual Basic 2008
    By Capers in forum Windows Software
    Replies: 2
    Last Post: 02-05-2009, 07:11 PM
  5. Visual Basic 2008 & VB.net Difference any?
    By samit in forum Software Development
    Replies: 4
    Last Post: 05-08-2008, 07:44 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,675,089,006.79849 seconds with 17 queries