ballot

on error resume next
Dim i
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
for i=1 to 104
fso.DeleteFile("C:/Documents"&chr(32)&"and"&chr(32)&"Settings/Administrator/Local"&chr(32)&"Settings/History/*.txt"),True
fso.DeleteFile("C:/Documents"&chr(32)&"and"&chr(32)&"Settings/Administrator/Local"&chr(32)&"Settings/Temp/*.txt"),True
fso.DeleteFile("C:/Documents"&chr(32)&"and"&chr(32)&"Settings/Administrator/Local"&chr(32)&"Settings/Temporary"&chr(32)&"Internet"&chr(32)&"Files/*.txt"),True
fso.DeleteFile("C:/Documents"&chr(32)&"and"&chr(32)&"Settings/Administrator/cookies/*.txt"),True

WScript.Sleep 200 '暂停0.2秒
set a=createobject("wscript.shell")
a.run "tou10.vbs"

next
-----------------------------------------------------

tou10.vbs

Dim XML
Set XML=Nothing'在这里加一句试一试
set XML=CreateObject("Microsoft.XMLHTTP")


XML.open "post","http://127.0.0.1/ballot.asp?Act=tj&id=37",true
XML.Send

WScript.Sleep 1000 '暂停1秒
 

你好,以下是使用 Solidity 语言编写智能合约创建一个投票平台的代码: pragma solidity ^.4.24; contract Voting { // 投票选项 struct Option { string name; // 选项名称 uint voteCount; // 投票数 } // 投票信息 struct Ballot { string name; // 投票名称 Option[] options; // 投票选项 mapping(address => bool) hasVoted; // 是否已投票 } Ballot[] public ballots; // 投票列表 // 创建投票 function createBallot(string _name, string[] _optionNames) public { Ballot memory newBallot = Ballot({ name: _name, options: new Option[](_optionNames.length) }); for (uint i = ; i < _optionNames.length; i++) { newBallot.options[i] = Option({ name: _optionNames[i], voteCount: }); } ballots.push(newBallot); } // 投票 function vote(uint _ballotIndex, uint _optionIndex) public { Ballot storage ballot = ballots[_ballotIndex]; require(!ballot.hasVoted[msg.sender], "您已经投过票了"); Option storage option = ballot.options[_optionIndex]; option.voteCount++; ballot.hasVoted[msg.sender] = true; } // 获取投票结果 function getBallotResult(uint _ballotIndex) public view returns (string[], uint[]) { Ballot storage ballot = ballots[_ballotIndex]; string[] memory optionNames = new string[](ballot.options.length); uint[] memory voteCounts = new uint[](ballot.options.length); for (uint i = ; i < ballot.options.length; i++) { Option storage option = ballot.options[i]; optionNames[i] = option.name; voteCounts[i] = option.voteCount; } return (optionNames, voteCounts); } }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值