简体   繁体   English

混淆aspx页面-c#代码位于aspx文件中

[英]Obfuscate aspx pages - c# codes are inside aspx files

Please take a look at this link : 请看一下这个链接:
http://forums.asp.net - Obfuscate aspx pages http://forums.asp.net-混淆aspx页面
I have the same problem and my problem is how can i obfuscate aspx pages with c# codes inside ? 我有同样的问题,我的问题是我该如何混淆内部带有C#代码的aspx页面?
I know for .net dlls we can use : 我知道我们可以使用.net dll:
Dotfuscator Dotfuscator的
Or 要么
Other third party programs... 其他第三方程序...
But what about aspx files with c# codes and my purpose is to obfuscate c# method names and strings in that file! 但是使用c#代码的aspx文件呢,我的目的是混淆该文件中的c#方法名称和字符串!

EDIT : 编辑
My aspx file is like this : 我的aspx文件是这样的:

<%@ Page Language="C#" Debug="true" trace="false" validateRequest="false" EnableViewStateMac="false" EnableViewState="true"%>
<%@ import Namespace="System.IO"%>
....
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
C# Codes...
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title></title>
<style type="text/css">
...
</style>
<script type="text/javascript">
...
</script>
</head>
<body>
<form id="" runat="server">
...
</form>
</body>
</html>

obfuscation of aspx(html) part is not important for me and only want to obfuscate C# Codes... aspx(html)部分的混淆对我而言并不重要,只希望混淆C#代码...

Edit 2 : 编辑2:
What is your purpose? 你的目的是什么?
Are you crazy? 你疯了吗?
No, i'm not. 不,我不是。
sometimes i don't have access to Visual Studio and want to write a little project very quickly in a single file with c# codes and gave it to my customer. 有时我没有访问Visual Studio的权限,并且想用c#代码在一个文件中非常快速地编写一个小项目,并将其交给我的客户。

Based on what you said, "how can i obfuscate such these files (aspx codes + c# codes in one file)?" 根据您所说的话,“如何混淆这些文件(一个文件中的ASPX代码+ C#代码)?” You cannot do that. 你不能这样做。 You can use the Code-Behind Model which is where you C# code in a separate file. 您可以使用“ 代码隐藏模型” ,即在单独文件中的C#代码所在的位置。

Code-Behind 代码隐藏

Code-behind refers to code for your ASP.NET page that is contained within a separate class file. 隐藏代码是指包含在单独的类文件中的ASP.NET页面的代码。 This allows a clean separation of your HTML from your presentation logic. 这样可以将HTML与表示逻辑完全分开。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM