在c#表单上保护我的瑞士法郎 [英] protect my swf on c# form

查看:85
本文介绍了在c#表单上保护我的瑞士法郎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Dears,

我正在Microsoft Visual Studio中开发一个C#windows应用程序。

C#表单会出现swf flash上​​传到本地文件。

现在,我想拒绝那些使用该应用程序复制swf文件的人。





谢谢提前

问候。

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.

推荐答案

差不多,你不能。

有可能加密该文件只能通过您的应用程序播放,或者您可以将它嵌入EXE文件中,如果它在您编译应用程序后没有更改。

但这些都取决于如何你的应用程序是有效的,我们对此没有任何线索。
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.


这是不可能的。

如果你想这样做,你必须在你的应用程序中有swf文件,你可以把EXE给别人。



-KR
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


实际上这个小技巧可以工作。假设在开发应用程序时确定了您的Flash文件(* .swf),您可以将它们作为资源文件添加到项目中。然后:



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:

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));
        }
    }
}


这篇关于在c#表单上保护我的瑞士法郎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆