高分:找懂PHP的帮忙翻译下代码成asp.net
PHP code:
function _authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) {
$ckey_length = 4;
$key = md5($key ? $key : UC_KEY);
$keya = md5(substr($key, 0, 16));
$keyb = md5(substr($key, 16, 16));
$keyc = $ckey_length ? ($operation == 'DECODE' ? substr($string, 0, $ckey_length): substr(md5(microtime()), -$ckey_length)) : '';
$cryptkey = $keya.md5($keya.$keyc);
$key_length = strlen($cryptkey);
$string = $operation == 'DECODE' ? base64_decode(substr($string, $ckey_length)) : sprintf('%010d', $expiry ? $expiry + time() : 0).substr(md5($string.$keyb), 0, 16).$string;
$string_length = strlen($string);
$result = '';
$box = range(0, 255);
$rndkey = array();
for($i = 0; $i <= 255; $i++) {
$rndkey[$i] = ord($cryptkey[$i % $key_length]);
}
for($j = $i = 0; $i < 256; $i++) {
$j = ($j + $box[$i] + $rndkey[$i]) % 256;
$tmp = $box[$i];
$box[$i] = $box[$j];
$box[$j] = $tmp;
}
for($a = $j = $i = 0; $i < $string_length; $i++) {
$a = ($a + 1) % 256;
$j = ($j + $box[$a]) % 256;
$tmp = $box[$a];
$box[$a] = $box[$j];
$box[$j] = $tmp;
$result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % 256]));
}
if($operation == 'DECODE') {
if((substr($r
相关问答:
我在一个ASPX页面中用 <!-- #include file="top.asp"-->嵌套了一个asp页面,但在点击按钮提交表单的时候没有任何反应,是不是两个FORM的原因造成的,top.asp里面也有一个form,把嵌套去掉的话,运行 ......
如题!
FileUpload1.PostedFile.FileName
我这样写了 但是还是获得的是一个文件的名称,FileUpload1.FileName 这个也是一样!
FileUpload1.PostedFile.FileName
IE 问题
工具-internet选项-安全- ......
select top 12 * from Product where [id] not in (select top 12 [id] from Product)
这样可以分页,但是我在后面想加个条件
select top 12 * from Product where [id] not in (select top 12 [id] from Prod ......
首先是webbrowser打印
怎么去掉左上角的 title; 右上角的 页码;左下角的地址;右下角的日期?分别设置。
页面内容超过纸张大小,只能打印一部分,怎么解决?有没有什么缩放功能?
其次是水晶报表的打印, ......
在c#里,
我做的是底层的插入。
实体层,数据层,业务层已经有表的属性了,
要实现将excel表里的内容插入到已有的数据库的某一表中。
比如excel表里有属性A,B,C,D,E
数据库里的表的名字是excelTable ......