vishnu reddy

vishnu reddy

  • NA
  • 3
  • 1.8k

Change a caller method to send you a file path

Mar 28 2012 11:03 AM
hello i am very new .NET and have a project that I need complete asap.

I need to change this particular caller method to send you a file path. write now its sending a byte array. can soemone please help me change the code.



{


private bool UploadTheFile()try

{


// prepare data


{


if ( Properties.Settings.Default.Encrypt )// get the file size and initialize the binaryFile


binaryFile =


FileInfo info = new FileInfo( BinaryPath() );new byte[ info.Length ];// load the encrypted file


{


{

r.Read( binaryFile, 0, binaryFile.Length );

}

}

}


using ( FileStream fs = new FileStream( BinaryPath(), FileMode.Open, FileAccess.Read ) )using ( BinaryReader r = new BinaryReader( fs ) )else

{


// copy/convert the text file

binaryFile =


{

binaryFile[ i ] = (

}

}


new byte[ textFile.Length ];for ( int i = 0; i < textFile.Length; i++ )byte )textFile[ i ];// upload data


{


using ( Ftp ftp = new Ftp() )//ftp.Push( fileName, binaryFile );

ftp.Push( FTP_FILE_NAME, binaryFile );

}

}


{



}



}

catch ( Exception Ex )EventLogger.Write( "File upload for " + fileName + " failed ", Ex );return false;EventLogger.Write( "File " + fileName + " successfully uploaded." );return true;


}

Answers (1)