TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
tin pro
NA
4
0
File conversion, select the encoding that makes your doument readable
Mar 7 2012 9:11 PM
Code is used for Encrypt file word(doc).
public void encrypt ()
{
TripleDESCryptoServiceProvider tdes = null;
string filename=@"C:\\test.doc"
string encContent = @"C:\\encrypttest.doc";
FileStream fin = new FileStream(fileName, FileMode.Open, FileAccess.Read);
FileStream fout = new FileStream(encContent, FileMode.OpenOrCreate, FileAccess.Write);
byte[] buff = new byte[10000];
int lenread;
try
{
tdes = new TripleDESCryptoServiceProvider();
CryptoStream encStream = new CryptoStream(fout, tdes.CreateEncryptor(), CryptoStreamMode.Write);
Console.WriteLine("\nEncrypting content ... ");
while ((lenread = fin.Read(buff, 0, 10000)) > 0)
{
encStream.Write(buff, 0, lenread);
}
encStream.Close();
fin.Close();
fout.Close();
}
catch (Exception)
{
}
}
After file "encryptest.doc" is created.I open "crypttest.doc" in Word.Word display message "File conversion, select the encoding that makes your doument readable.Text encoding:".help please how do i disable or skip error message
Reply
Answers (
0
)
How to configure outlook using c#?
How to add a digital signature generated by smart card to a MS Office word document