Jump to content

Bushranger

Members
  • Posts

    18
  • Joined

  • Last visited

Everything posted by Bushranger

  1. Addendum: I have downloaded Visual Studio 2019 Community and found that I was able to import my project from Visual Basic 2010 into it. At this point I am working on getting to understand and use the Profiling feature in its Debug. Again, thank you to mavhc for the helpful suggestion that I look into upgrading to Visual Studio 2019 Community...I did not know that the upgrade and Profiling even existed.
  2. It may be the different cultures, but how does the above article help me in any way with a "hobbie" program that is running slow. Was there any suggestion in that article as to how to get the program to run faster?
  3. For the fun of it...the challenge of it...for the interest in the history of it (please read my first post).
  4. You are correct...it will not likely ever be a commercial application. However, the method does work...and works very well in a cryptologic sense, employing several anti-code breaking techniques and it does encrypt and decrypt plain text (upper and lower case, numeric, and all the standard keyboard characters) successfully.
  5. Adults only please.
  6. Can you give your rationale why it is a bad idea to create my own encryption system?
  7. I changed my program so that it wrote the data as processed into a textbox and not writing to the disk. I added a button control that then wrote the data to the disk file. It would to go faster at first, then would bog down (speed of processing as indicated by the progress bar), but eventially always finishes. But in all it was faster...but obvious to me there is still a problem. At this point it seems that I don't have much choice but to upgrade to get the Profiling feature.
  8. It would appear that Profiling is not available with Visual Basic 2010 Express (what I am using). However it is part of Visual Studio 2019. My question now becomes: If I upgrade to Visual Studio 2019 to get the Profiling tools, will my existing program remain intact? Also, after studying my program, It occurred to me that the bottle neck may be due to the fact that there are string data being appended to a disk file throughout the processing of the data. That is, there are many, many writes to the disk to append the file. I suspect that I can eliminate the bottle neck (if that is truly the cause), by appending all the data into a text box and then writing it to the file after the process is completely finished. In other words, frequent appends to the text box instead of to the file on the hard drive. Does that sound like I could be on the right track?
  9. I think that the program that was suggested, "Profiling", will be all I need for awhile.
  10. Thank you...that program looks to be very useful in my endeavors. As I have posted (in another thread), my program (which I started many years ago, originally in VB2, then re-programed in VB 2010 Express about five years ago), was written as a self-challenge due to my (compulsive) interest in history and the WWII German Enigma Code and the British Bletchley Park de-coding effort. So, the program has no practical application, nor can I envision one at this time. Nevertheless, I would eat my underwear if anyone could take a message that has been encrypted by my program and figure it out without using my program to solve it. It cannot be solved using statistical analysis, etc. It is for fun and to help keep my mind sharp inasmuch as I am an elderly person. However, being a High-Functioning Asperger's person, the fact that it runs way too slow (inefficient), drives me to distraction (as an "ASPY" I am compelled to "fix" broken things.).
  11. My own invention...three different levels all involving Select Case statements. I would describe it as changing English characters into a different alphabet and then changing it into another different alphabet and then changing it yet again. I won't go into it any deeper because it is a "secret" method after all.
  12. Using Visual Basic 2010 Express, Windows 10, 8GB ram. I wrote a text encrypting program about five years ago. It works, however the part of the program that encrypts the text runs very slow (30 seconds or more for a one sentence message). Which makes no sense to me in that the part of the program that un-encrypts the data runs very fast (3 seconds or less). Some posters have suggested using Multithreading or Backgroundworker, however that does not seem a remedy in that my program does not require the operator to do anything but wait for the data to process. I have read that there are techniques to make the coding more efficient. For instance, I read where instead of using the word "string" to declare a data type, I use a "$" to declare staring data which uses less memory. That is what I am looking for...more efficient programing in that my crude method of programing may be causing the slowness of that part of the program. I am also concerned about the scope of my declarations my not be correct and contributing to the problem. For instance I have "Dim", "Friend" and "Public" in my declarations...can that cause a problem with speed? Suggestions welcome.
  13. I took a cursory look at Multithreading and was warned off by some of the posts about it. I will also take a look at BackGroundWorker when I get the chance. Thanks for the heads-up.
  14. I am not sure if I understand your question, but I will take a shot at it anyway. In my program, once the operator enters the text and clicks the control that encrypts it, I do not want them doing anything until the text has been processed. It is a single purpose program. The only option I have given the operator is to quit the program. A problem I have run into, is that it takes an inordinate amount of time to process (encrypt) the text which, inasmuch as un-encrypting the same text/message is very fast compared to encrypting it although one process is just a reverse of the other and should take the same amount of time. It is confusing in that, the program works and as such, cannot be too serious of a problem. I put the progress bar into the program and will put a "percent completed" textbox in it to aid me in finding out why the encrypting code is taking so long compared to the un-encrypting code processing. But, it is merely a hobby for me (have long been fascinated with the WWII Bletchley Park Code breaking and the Enigma Machine), I have no expectation that anyone would want a text message encrypting program...other than the odd terrorist or two.
  15. Whoops! I worked on the problem this afternoon and I have gotten the Progress bar to match with the data (fill the bar regardless of the amount of data). I added the following line of code: Form3.ProgressBar1.Maximum = NumberOf
  16. Sorry about that messy first post. Just to refresh memories, I have a progress bar on my Form3. The data processed (text encryption), on Modual1. I got the progress bar to work, but it does not fill the progress bar completely. The data processed is variable in length and what happens is the progress bar shows the data being processed but stops relative to the amount of data it processed. I want the progress bar to fill to 100% regardless of the amount of data processed. But being old, I am having a problem figuring it out. Here is a code snippet from my Modual1. What coding would make the bar fill no matter the size/length of the data? 'Code for progress bar: 'Give percent of data processed...not using this yet. Dim Percentage As String = CType((Form3.ProgressBar1.Value / NumberOf * 100), Integer).ToString & "%" 'Counts the number of charators being processed. NumbCounter = NumbCounter + 1 If NumbCounter > Form3.ProgressBar1.Maximum Then NumbCounter = Form3.ProgressBar1.Maximum End If Form3.ProgressBar1.Value = NumbCounter 'Updates progress bar on Form3...this works. 'Not using percentage yet. Form3.Label14 = Percentage
  17. I wrote a text encrypting program about five years ago. The program worked fine. However, now retired (76 years old), I am fooling around with programming agin. I cannot get the Progress bar to work. I want it to be activated by Button3 on Form3. I have commented out my attempt at a progress bar inasmuch as it did not work anyway. Here is the code...can someone please help me to get it to work? Note: Wrapping code tags around my selection of code did not produce the expected result...did not keep the carriage returns...just put everything jumbled together. So, I guess the first question should be, how can I get my code to display correctly? Public Class Form3 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click End End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click 'Checks for password, desplays message if null, goes to Pass/path form5. If Form5.TextBox3.Text = "" Then MessageBox.Show("You must enter a password first.") Me.Hide() Form5.Show() End If 'Take the text from TextBox1 and assign it to string variable "Source". Dim Source As String = TextBox1.Text Dim fileReader As String 'combines password with contentents of the Text Box into string varible named, "Source". Source = strPassWordVar & Me.TextBox1.Text '********************************************************** Label3.Visible = True '**********Encrypting text...this will take awhile.*************** Me.Refresh() 'Call the Encrypt function Encrypt and pass it the Source varible. Call Encrypt(Source) '********************************************************* 'Private Sub ProgressBar1_Click(sender As System.Object, e As System.EventArgs) Handles ProgressBar1.Click ' Dim i As Integer ' ProgressBar1.Minimum = 0 ' Sets the Maximum for the progress bar to the lenght of the of the combined string (NumerOf). ' ProgressBar1.Maximum = NumberOf ' For i = 0 To NumberOf ' ProgressBar1.Value = i ' Next 'End Sub '************************************************* 'Reads encrypted from disk file into Form3 Text Box 2. fileReader = My.Computer.FileSystem.ReadAllText(strWholePathVar) Me.TextBox2.Text = (fileReader) Label3.Text = "Encryption complete." End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click 'Check that file exists If My.Computer.FileSystem.FileExists(strWholePathVar) = False Then MessageBox.Show("File was not found.") Else ' delete the file Kill(strWholePathVar) MessageBox.Show("File was deleted, directory remains.") End If End Sub End Class
×
×
  • Create New...