Pages to the People

镏金的岁月已经远去·放下幻想吧· 战斗就在眼前·2009中国·世界

【推荐】一些不错的淘宝IT类店铺

C+获取系统信息

 

2009-02-08 13:47

 

LPTSTR lpszSystemInfo;
DWORD cchBuff=256;
TCHAR tchBuffer2[100];
DWORD dwResult;
SYSTEM_INFO siSysInfo;

TCHAR tchBuffer[100];
lpszSystemInfo=tchBuffer2;

//获得计算机名
GetComputerName(lpszSystemInfo,&cchBuff);
m_pcname.SetWindowTextA(lpszSystemInfo);

//获得当前用户名

GetUserName(lpszSystemInfo,&cchBuff);
m_username.SetWindowTextA(lpszSystemInfo);

//获得Windows目录

int nSize=GetWindowsDirectory(lpszSystemInfo,MAX_PATH);
m_windir.SetWindowTextA(lpszSystemInfo);

//获得TMP环境变量

dwResult=ExpandEnvironmentStrings("TMP=%TMP%",lpszSystemInfo,100);
m_path.SetWindowTextA(lpszSystemInfo);  

 

 

Js让html文件支持参数传递

 

Js让html文件支持参数传递
2008-08-07 09:07

 

首先申明,这篇不是我的原创,是我由一篇文章加入了很多自己的见解。原文作者不知道被哪个没素质的把版权去掉了,到我手上已经是一盗再盗了~~~    所以本文没有版权信息

modified by: http://hi.baidu.com/biweilun

这段时间Javascript搞得很火,一些新的技术也被挖掘出来,比如html文件居然可以提交参数了。大家看到如下的URL应该不陌生:http://www.baidu.com/index.asp?ID=334   当然,这并不是真实的URL,只是Trajon.BWL举的一个假例子。

为什么asp文件或是aspx可以接受参数呢?因为他们有request方法。一个request("ID")就能顺利搞定。问题是html文件没有,很久以前我上网看到一个这样的链接,确实吓了一大跳:http://www.baidu.com/at/index.html?ID=123

当时我就在想,这是怎么回事?html文件啥子时候也能接受参数了?后来终于知道这是通过Js来实现的,雏形如下:

<html>
<script>
var i=0;
function ol()
{
i=location.href.indexOf("?");
if(i!=-1)
{
str=location.href.substr(i+1,location.href.length-i-1);
alert('你提交的参数为'+str);
document.open(true);
document.write(unescape(str));
document.close();
}
else
{
i=location.href.length;
}
}
function os()
{
str=location.href.substr(0,i)+"?"+document.all.tags("textarea").item(0).value;
location.href=str;
}
</script><body onload="ol()">
<br>
<button onclick="os()">看看结果</button>
</body>
</html>

现在这个html文件就能实现ID传输了,当然这只是一个雏形,很多功能并不完善。我看现在网上对这种html的参数提交漏洞没什么介绍,有空我去研究下看看,说不定我也能掀起html边界注入的潮流,先YY一下,(*^__^*) 嘻嘻……