In this code I am trying to call PW_InFile = Encryption.DencryptString(PW_InFile, strengthLength);
but it does not work. I can't check if the code in public static DencryptString(string PW_InFile, int stringLength) works.
The button13_Click procedure works up until the class call. If I hover over the call it says "Cannot implicitly convert 'void' to a string
Can you help me?
--------------------------------------------------------------------------------------------------
but it does not work. I can't check if the code in public static DencryptString(string PW_InFile, int stringLength) works.
The button13_Click procedure works up until the class call. If I hover over the call it says "Cannot implicitly convert 'void' to a string
Can you help me?
private void button13_Click(object sender, EventArgs e) { string line; string PW_InFile = ""; // Read the file string path = Directory.GetCurrentDirectory(); System.IO.StreamReader file = new System.IO.StreamReader(path + "\\MyDataPW.txt"); while ((line = file.ReadLine()) != null) { PW_InFile = line; } file.Close(); //LETS DE-ENCRYPT IT int strengthLength = PW_InFile.Length; PW_InFile = Encryption.DencryptString(PW_InFile, strengthLength); }
--------------------------------------------------------------------------------------------------
namespace MyData { public class Encryption { public static DencryptString(string PW_InFile, int stringLength) { String STEMP = ""; for (int i = 0; i < stringLength; i = i + 3) { STEMP = PW_InFile.Substring( i, 3) - 103; } return PW_InFile = STEMP;//RETURN THE DECRYPTED STRING } } }
Last edited by a moderator: