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
parameswaran G
NA
18
2.2k
Encrypt and Decrypt swf
May 16 2012 3:36 AM
hi
i am using this code. i have run the project encrypt in Successful. but how to decrypt kindly help me.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using AxShockwaveFlashObjects;
using System.Runtime.CompilerServices;
namespace T4_1
{
public partial class Form1 : Form
{
string path1 = @"C:\Documents and Settings\paramesh\Desktop\EN_test\E06_01.swf";
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// CodeWithCleanup();
decrypt_fun();
axShockwaveFlash1.Movie = path1;
// RuntimeHelpers.TryCode tryCode = new RuntimeHelpers.TryCode();
}
//==================================
public void CodeWithCleanup()
{
System.IO.FileStream file = null;
System.IO.FileInfo fileInfo = null;
try
{
fileInfo = new System.IO.FileInfo(path1);
file = fileInfo.OpenWrite();
file.WriteByte(0xF);
}
catch (System.UnauthorizedAccessException e)
{
System.Console.WriteLine(e.Message);
}
finally
{
if (file != null)
{
file.Close();
}
}
}
//=============================================
public void decrypt_fun()
{
//
// Read the contents of Encoded Bitmap from the text file.
//
TextReader reader = new StreamReader(path1);
String imageString = reader.ReadLine();
//
// Decode the Base64-Encoded binary whic previously read from the
// text file above.
//
byte[] imageBytes = Convert.FromBase64String(imageString);
//
// Create a new image file.
//
FileStream fs = new FileStream(path1, FileMode.Create, FileAccess.Write);
BinaryWriter writer = new BinaryWriter(fs);
try
{
for (int i = 0; i < imageBytes.Length; i++)
{
writer.Write(imageBytes[i]);
}
}
finally
{
writer.Close();
fs.Close();
}
Console.ReadLine();
}
//======================================
}
}
Reply
Answers (
0
)
Creation of thermometer
How to create a login in VB.NET