虚位以待(AD)
虚位以待(AD)
首页 > 网络编程 > ASP编程 > ASP编程中达到对MediaPlayer控件播放文件地址隐藏的解决方案

ASP编程中达到对MediaPlayer控件播放文件地址隐藏的解决方案
类别:ASP编程   作者:码皇   来源:互联网   点击:

在播放视频时,直接查看页面源文件可看到视频文件地址,MediaPlayer控件播放器将在页面上加上如下初始化语句:  MediaPlayer控件初始化可查看到源文件地址  Sys Application add_init(function()  {  ,魔客吧

在播放视频时,直接查看页面源文件可看到视频文件地址,MediaPlayer控件播放器将在页面上加上如下初始化语句:

  MediaPlayer控件初始化可查看到源文件地址

  Sys.Application.add_init(function()

  {

  $create(Sys.UI.Silverlight.MediaPlayer,

  {

  "autoPlay":true,"mediaSource":"http://211.142.31.235/Nas1/VOD/CP0001/490Kbps/D/DI/DIA/DiaoZhongYuan1/DiaoZhongYuan1.wmv",

  "scaleMode":2,"source":"UserControl/playerTheme/player.xaml","volume":1},

  null, null,

  $get("myUserMediaPlayer_player_parent"));

  });

  解决方案是先建立一个字符串加密解密服务

  加密、解密工具类

  1/**////

  2 /// 对字符串进行、加解密的工具类

  3 ///

  4 public class DESEncryptor

  5 {

  6 静态公共技术#region 静态公共技术

  7 /**////

  8 /// 对字符串进行加密

  9 ///

  10 /// 源字符串

  11 /// 加密后的字符串

  12 public static string ExecEncrypt(string strSource)

  13 {

  14 DESEncryptor desEncryptor = new DESEncryptor() ;

  15 desEncryptor.InputString = strSource ;

  16 desEncryptor.DesEncrypt() ;

  17 return desEncryptor.OutString ;

  18 }

  19 /**////

  20 /// 对已经加密的字符串进行解密

  21 ///

  22 /// 已经加密的字符串

  23 /// 还原后的字符串

  24 public static string ExecDeEncrypt(string strSource)

  25 {

  26 DESEncryptor desEncryptor = new DESEncryptor() ;

  27 desEncryptor.InputString = strSource ;

  28 desEncryptor.DesDecrypt() ;

  29 return desEncryptor.OutString ;

  30 }

  31 #endregion

  32

  33 私有成员#region 私有成员

  34 /**////

  35 /// 输入字符串

  36 ///

  37 private string inputString=null;

  38 /**////

  39 /// 输出字符串

  40 ///

  41 private string outString=null;

  42 /**////

  43 /// 输入文件路径

  44 ///

  45 private string inputFilePath=null;

  46 /**////

  47 /// 输出文件路径

  48 ///

  49 private string outFilePath=null;

  50 /**////

  51 /// 加密密钥

  52 ///

  53 private string encryptKey="fanmenglife";

  54 /**////

  55 /// 解密密钥

  56 ///

  57 private string decryptKey = "fanmenglife";

  58 /**////

  59 /// 提示信息

  60 ///

  61 private string noteMessage=null;

  62 #endregion

  63

  64 公共属性#region 公共属性

  65 /**////

  66 /// 输入字符串

  67 ///

  68 public string InputString

  69 {

  70 get{return inputString;}

  71 set{inputString=value;}

  72 }

  73 /**////

  74 /// 输出字符串

  75 ///

  76 public string OutString

  77 {

  78 get{return outString;}

  79 set{outString=value;}

  80 }

  81 /**////

  82 /// 输入文件路径

  83 ///

  84 public string InputFilePath

  85 {

  86 get{return inputFilePath;}

  87 set{inputFilePath=value;}

  88 }

  89 /**////

  90 /// 输出文件路径

  91 ///

  92 public string OutFilePath

  93 {

  94 get{return outFilePath;}

  95 set{outFilePath=value;}

  96 }

  97 /**////

  98 /// 加密密钥

  99 ///

  100 public string EncryptKey

  101 {

  102 get{return encryptKey;}

  103 set{encryptKey=value;}

  104 }

  105 /**////

  106 /// 解密密钥

  107 ///

  108 public string DecryptKey

  109 {

  110 get{return decryptKey;}

  111 set{decryptKey=value;}

  112 }

  113 /**////

  114 /// 错误信息

  115 ///

  116 public string NoteMessage

  117 {

  118 get{return noteMessage;}

  119 set{noteMessage=value;}

  120 }

  121 &nb

123下一页
相关热词搜索: ASP编程中达到对MediaPlayer控件播放文件地