我该如何播放我自己的电影,而不是任何电影 [英] How can i play my own film,and not any film

查看:80
本文介绍了我该如何播放我自己的电影,而不是任何电影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要播放电影[N] .wmv(film1.wmv,film2.wmv等),它们存储在DVD或CD中
我的程序本身没有问题.因为我想限制我的程序只能播放某些电影,而不是CD或DVD中的任何电影.
请给我一个建议,使我可以强制我的程序仅播放程序附带的电影(我的电影存储在CD或DVD中).

你应该考虑这些
1-如果用户用我的电影代替我的电影,该程序将无法正常运行
他可以通过提供与我的名字相同的电影来欺骗该节目
2-如果您的建议需要程序语法,请在您的答案中提供它

谢谢

I want to play a film[N].wmv (film1.wmv, film2.wmv,etc) they are stored in a DVD or CD
I have no problem in the program its self. Because i want to restrict my program to play a certain films and not any films from the CD or DVD.
Please give me a suggestion by which I can force my program to play only the films that i have provided with my program (my films are stored in CD or DVD) .

You should put those into consideration
1- The program shall not work if the user has substitute my films with his films
He can trick the program by providing films that has name same as mine
2- If your suggestion require program syntax kindly provide it in your answer

Thanks

推荐答案

最简单的方法?
取每个您要播放的文件的SHA哈希,将其与文件名结合起来,然后保存到您的程序中.
当您播放文件时,请根据存储的文件名检查文件名和基于磁盘的文件的SHA哈希.
如果它们匹配,请播放它们.
如果他们不...

代码并不难,您可以在本技巧/窍门中找到大部分的相关方法: ^ ]



致OriginalGriff
我应该在哪里放置用户名和密码
我认为最好的地方是将它们复制为电影的标题,即
如果电影的长度是100字节,并且(用户名+密码)长度是10,那么我的电影应该从
开始 字节11到字节110.因此在播放电影之前,我必须读取第1个10字节并将其作为用户名和密码进行检查.
我说的对吗?"


不,那不是我的意思.
1)以字节流的形式读取电影.
2)使用GetSHA1例程的相关部分来计算影片的SHA.
3)注意文件名和SHA1哈希值以供以后使用.
4)对所有电影重复.
5)将您在(3)中保存的值包括在程序中,以便稍后进行检查.
6)在程序中,当您要播放电影时,再次对CD/DVD中的文件进行(2)
7)对照在(5)中使用的文件名和SHA哈希值进行检查.

我不建议修改这部电影,因为我不知道这将对播放器产生什么影响!
Easiest way?
Take the SHA hash of each file you wish to play, combine it with the name of the file, and save it into your program.
When you go to play a file, check the file name, and the SHA hash of the disk based file against those you stored.
If they match, play them.
If they don''t...

The code isn''t difficult, you will find the relevant methods for most of it in this tip / trick: Password Storage: How to do it.[^]



"To OriginalGriff
Where should I place the userid and password
Best place I think is to copy them as a header of the film ,another word
If the film length is 100 byte and the (userid + password) length is 10 then my film should start from
Byte 11 up to byte 110. so before I play the film I have to read the 1st 10 byte and check them as a userid and password .
Am I Right?"


No, that isn''t what I meant.
1) Read your film as a stream of bytes.
2) Use the relevant part of the GetSHA1 routine to calculate the SHA for the film.
3) Note the file name and the SHA1 hash value for later.
4) Repeat for all films.
5) Include the values you have saved at (3) in your program, so you can check them later.
6) In your program, when you want to play a film, do (2) again on the file from CD/DVD
7) Check this against the file name and SHA hash value you used at (5).

I wouldn''t recommend modifying the film, as I have no idea what effect this would have on the player!


这篇关于我该如何播放我自己的电影,而不是任何电影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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