如何在c#.net windows应用程序中保护两个exe之间的exe? [英] How to protect one exe between two in c# .net windows application?

查看:79
本文介绍了如何在c#.net windows应用程序中保护两个exe之间的exe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



如何在c#.net windows应用程序中保护两个exe之间的一个exe?



我正从我的.net应用程序运行其他exe。

我需要,其他exe不应该直接从应用程序目录运行。

它应该只通过.net应用程序运行。



如何使用c#.net windows应用程序保护其他exe文件?



请帮助我。



先谢谢。



Ankit Agarwal

软件工程师

Hello,

How to protect one exe between two in c# .net windows application?

I am running other exe from my .net application.
I need, other exe should not be run directly from application directory.
It should run only through .net application.

How can we protect other exe using c# .net windows application?

Please help me.

Thanks in Advance.

Ankit Agarwal
Software Engineer

推荐答案

在第一个exe中执行以下操作:



In first exe do the following stuff:

static void Main(string[] args)
{
   
    if(args[0]=="someValuePassedFromSecondeExe")
    {
      Console.WriteLine("Welcome to exe 1")   
    }
  else 
   {  
   Console.WriteLine("Sorry!, you can run this exe1 from exe 2 only.")   
   }
}


Hi Ankit,



这是另一种解决问题的安全方法:http://msdn.microsoft.com/en-IN/library/ms173139(v=vs.80).aspx [ ^ ]



但是我想知道为什么你需要这个,如果你想在你的Exe下运行它,那么请把它建成一个程序集并附加到你的应用程序。



如果你有任何困难要理解上面的例子,那么请求评论。





谢谢,

Suvabrata
Hi Ankit,

Here is a another secure way to solve your problem : http://msdn.microsoft.com/en-IN/library/ms173139(v=vs.80).aspx[^]

But I wonder why you required that if you want to run it under your Exe only then please build it as a assembly and attach to your application.

If you have any difficulty to understand above example then please comment.


Thanks,
Suvabrata


这篇关于如何在c#.net windows应用程序中保护两个exe之间的exe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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