Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links

help on visual basic 2008

Software Development

Thread Tools Search this Thread
Old 17-03-2011
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)

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

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


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)


encryptedms = alphabet.Substring(newvalue, 1)

End If

counter = counter + 1
counter2 = counter2 + 1

encryptLabel.Text = encryptLabel.Text & encryptedms


Reply With Quote
Old 18-03-2011
Join Date: Dec 2007
Posts: 2,273
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.
Reply With Quote

  TechArena Community > Software > Software Development
Tags: , , ,

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

All times are GMT +5.5. The time now is 05:47 AM.