I am trying to make a substitution cipher solver in vb.net but whenever I try to solve a cipher text using methods other than shift it goes back to the original. This is the code I have so far - Dim Ctl As Control, nAsc As Int16
-
For Each Ctl In Panel2.Controls
-
If TypeOf (Ctl) Is TextBox Then
-
nAsc = Asc(Microsoft.VisualBasic.Left(Ctl.Name, 1))
-
If Reverse.Checked = False Then
-
nAsc = nAsc + Shift.Value
-
Else
-
nAsc = 90 - nAsc + 65 + Shift.Value
-
End If
-
If nAsc > 90 Then nAsc = nAsc - 26
-
If nAsc < 65 Then nAsc = nAsc + 26
-
Ctl.Text = Chr(nAsc)
-
End If
-
Next
-
SolutionSubstitution.Text = EncryptionSubstitution.Text
-
Dim sourceChar As Char
-
For Each Ctl In Panel2.Controls
-
If TypeOf (Ctl) Is TextBox Then
-
sourceChar = Microsoft.VisualBasic.Left(Ctl.Name, 1)
-
SolutionSubstitution.Text = SolutionSubstitution.Text.Replace(sourceChar, Chr(Asc(Ctl.Text) + 128))
-
-
End If
-
Next
-
For Each Ctl In Panel2.Controls
-
If TypeOf (Ctl) Is TextBox Then
-
sourceChar = Chr(Asc(Microsoft.VisualBasic.Left(Ctl.Name, 1)) + 128)
-
SolutionSubstitution.Text = SolutionSubstitution.Text.Replace(sourceChar, Microsoft.VisualBasic.Left(Ctl.Name, 1))
-
-
End If
-
Next
-
does anyone have any suggestions
as you can see from the attachments when I press solve it goes back to the original text
0 1422 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Aaron |
last post by:
I am trying to write a Python script file which analyses data in an
iterative manner. During each iteration, I wish to utilise the Solver
function in Excel to perform some constrained, non-linear fitting to
the data. I have a VBA macro which runs the Solver, and am using
self.xlapp = win32com.client.dynamic.Dispatch("Excel.Application")
..
..
..
self.xlapp.run(macro)
|
by: Michael Sparks |
last post by:
Hi,
I suspect this is a bug with AMK's Crypto package from
http://www.amk.ca/python/code/crypto , but want to
check to see if I'm being dumb before posting a bug
report.
I'm looking at using this library and to familiarise myself writing
small tests with each of the ciphers. When I hit Crypto.Cipher.ARC4 I've
|
by: Carl Harris |
last post by:
I am trying to write some code to:
1.Prompt a user for filenames
2.Open the files
3.Convert my plain text into a cipher text array/string
bear in mind I am a novice!
I have wriiten some code already which completes takes 1 and 2 but
haven't got a clue with the conversion (task 3)
|
by: Piotr Turkowski |
last post by:
Hi,
The code is here: http://free.ud.pl/~piotr/data/vigenere.zip
Its my program for decrypting and encrypting text.
Shot polish course:
szyfrowanie (szyfruj) - encrypting (text i want to code ->
(*(^%&^GHJBBVvkek)
odszyfrowanie (deszyfrowanie) - decrypting ( *^BNHJ*&% - > secret text)
obsluga plikow - using files
|
by: Mr.Doubt |
last post by:
I'm trying to run a Excel macro, which uses SOLVER.XLA Add-In, in
VB.NET application. When the macro is executed I get the following
error message
"Solver: An unexpected internal error occured, or
available memeory was exhausted"
Any suggestions whats causing this error and how to debug it???
Also, I get the following exception message when executing all the
| |
by: Julio C. Hernandez Castro |
last post by:
Dear all,
We have just developped a new block cipher called Raiden, following a
Feistel Network structure by means of genetic programming. Our
intention now consists on getting as much feedback as possible from
users, so we encourage you to test the algorithm and send us your
opinion. We would also like to receive enhancements and new versions of
the algorithm, developed in other source languages and platforms.
Our idea on developing...
|
by: beetle17 |
last post by:
Plaintext: a n i c e d a y
Key: -3
Ciphertext: X k f Z b a X v
Cipher will accept commands from the user and perform the operations required by the commands. There are three different commands. Key command starts with "K1:"followed by a string as the key. Encryption command starts with "E1:" followed by the plaintext. Decryption command starts with "D1:" followed by the ciphertext to be decrypted. After the user inputs an encryption...
|
by: Holger Fitschen |
last post by:
Hi to all,
I want to use the Excel solver in a VB.Net project.
The macro
Sub Makro1Solver()
Application.Run "Solver.xla!Auto_Open"
SolverReset
Worksheets(1).Select
Worksheets(1).Range("B9").Select
|
by: wagn31 |
last post by:
i need to use a cipher but I have to used the assigned code in the ciphering i know how to do it, but i am not sure how to add my own dictionary. Here is what i have so far:
|
by: akristensen |
last post by:
I am new to this site, so be patient if I do not ask the question correctly.
Current Target Platform: Browser: MS IE, script language: Javascript (will use VBScript, but JS is preferred), External apps: MS Excel
What I need to do: From a web page using javascript, I open a new Excel application and sheet, populate some information into it. After it is populated with some information, I need to run the "Solver..." option on the data in the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |