Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Qualify with a Type Name error in C# code (http://www.go4expert.com/forums/qualify-type-error-c-sharp-code-t22580/)

crt616 29Jun2010 00:43

Qualify with a Type Name error in C# code
I am new to C# and having to take sample code for encrypting ICVerify transactions for credit card processing. Below is a copy of the code but I am getting an error of
" Error 1 Member 'ConsoleApplication1.EncryptionManager.EncryptThir dPartyMessage(string, string)' cannot be accessed with an instance reference; qualify it with a type name instead C:\Documents and Settings\relosegui\my documents\visual studio 2010\Projects\EncryptMe\EncryptMe\Encrypt.cs 45 40 EncryptMe"
for the code highlighted in pink

Can anyone offer assistance as to what may be my problem may be?


namespace ConsoleApplication1
    public class EncryptionManager
        public static extern string EncryptThirdPartyMessage(string filePath, string stringToEncrypt);
    class Program
        static void Main(string[] args)
            // File name format that ICVERIFY understand for request processing
            string csFileName = "\\icver001.out";
            // Shared directory path where file is being created.
            string txtSharedDirPath = "C:\\Prod";
            string csSharedDirPath = txtSharedDirPath + csFileName;
            // Request directory path where file will be used by
            // ICVERIFY for transaction processing.
            string txtReqPath = "C:\\ICVERIFY\\ICWin404\\ICPool";
            string csReqPreparationPath = txtReqPath + csFileName;
            // Object of StreamWriter
            StreamWriter objWriter = null;
            // This code is creating an empty file in shared directory path
            FileStream objFileStream = new FileStream(csSharedDirPath, FileMode.Create, FileAccess.Write);
            objWriter = new StreamWriter(objFileStream);
            // To call EncryptionManager.dll to encrypt string
            // EncryptionManager.dll will use the creation date of the
            // file that was being created in shared directory path.
            string csStringToEncrypt = "Some string";
            EncryptionManager objEncryptionManager = new EncryptionManager();
            string csEncryptedString = objEncryptionManager.EncryptThirdPartyMessage(csSharedDirPath, csStringToEncrypt);
            // To write the encrypted string in the file
            if (objWriter != null)
            // Once all the encrypt strings have been written in file,
            // move that file into the request directory for processing.
            File.Move(csSharedDirPath, csReqPreparationPath);

All times are GMT +5.5. The time now is 21:40.