Click here to Skip to main content
15,889,315 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dears,
I am developing a C# windows application in Microsoft visual Studio.
C# form will appear swf flash uploaded on local file.
Now, i want to deny people who took that application to copy swf file.


Thanks in advance
Regards.
Posted

Pretty much, you can't.
It may be possible to encrypt the file so that it will only play via your application, or you may be able to embed it in your EXE file if it doesn't change after you compile your app.
But those both depend on how your app works, and we don't have a clue about that.
 
Share this answer
 
It is not possible.
And still if you want to do so, you must have swf file in your application, and you can give EXE of it to others.

-KR
 
Share this answer
 
actually this little trick may work. assuming that your flash files (*.swf) are determined while you develop your application, you can add them as resource files in your project. then:

C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Test_Flash
{
    public partial class Form1 : Form
    {
        List<string> tempFiles = new List<string>();

        public Form1()
        {
            InitializeComponent();
            this.FormClosed += Form1_FormClosed;
        }


        private void button1_Click(object sender, EventArgs e)
        {
            string p = Path.GetTempFileName();
            this.tempFiles.Add(p);

            // open temporay file
            using(FileStream fs = new FileStream(p, FileMode.Open))
            {
                // write your flash resource into that file.
                fs.Write(Test_Flash.Properties.Resources.harfa, 0,
                    Test_Flash.Properties.Resources.harfa.Length);
            }
            // play it
            this.axShockwaveFlash1.LoadMovie(0, p);
        }

        void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            // remove all temporary files
            tempFiles.ForEach(f1 => File.Delete(f1));
        }
    }
}
 
Share this answer
 
There is no way to stop people from copying your SWF file.

1) You cannot use NTFS security to "protect" the file because the operation of reading the file for play in the player is no different than reading the file to copy it. They are exactly the same. If you remove permissions so someone cannot copy the file, they also cannot play the file in your application.

2) Adding the file to your applications resources is not going to "protect" it either. There are lots of resource editing tools out on the web that can take any resource stream in your application and write it to a file. Again, you cannot stop someone from reading the contents of the .EXE file as you would also be stopping them from running your .EXE file.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900