抽签软件代码,测财运的软件怎么做
求一抽签程序代码
一共可以抽几次
例如1-10 中
求一个随机抽签不重复软件或.exe程序,1-54之间不重复。哪位能帮忙?谢谢...
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace RandDemo
{
class Program
{
static void Main(string[] args)
{
System.Random rdm1 = new Random(unchecked((int)DateTime.Now.Ticks));
Console.WriteLine(rdm1.Next(1,54)); //输出1-54之间的一个随机数
}
}
}
如果只要整数的话是,不可能不重复的。
VB制作抽签程序
Public j As Integer
Dim A() As String
Dim tem As String
Private Sub CMD1_Click() '注意这里如果没有exit sub,责会出现captio不会变的,其实已经变过了
If CMD1.Caption = "开始" Then
CMD1.Caption = "停止"
Timer1.Enabled = True
Exit Sub
End If
If CMD1.Caption = "停止" Then
CMD1.Caption = "开始"
Timer1.Enabled = False
If tem <> "" Then
Text1.Text = tem
End If
End If
End Sub
Private Sub CMD2_Click()
Frame1.Visible = True
Text2.Visible = True
CMD3.Visible = True
CMD4.Visible = True
End Sub
Private Sub CMD3_Click()
Text2.Visible = False
CMD3.Visible = False
CMD4.Visible = False
tem = Text2.Text
End Sub
Private Sub CMD4_Click()
Text2.Text = ""
Text2.Visible = False
CMD3.Visible = False
CMD4.Visible = False
End Sub
Private Sub form_load()
Frame1.Visible = False
Text2.Visible = False
CMD3.Visible = False
CMD4.Visible = False
Timer1.Enabled = False
Timer1.Interval = 300
Open "C:\Documents and Settings\Administrator\桌面\新建 文本文档.txt" For Input As 1
Do Until EOF(1)
ReDim Preserve A(0 To I)
Input #1, A(I)
I = I + 1
Loop
Close #1
End Sub
Private Sub Timer1_Timer()
Text1.Text = A(j)
j = j + 1
If j = UBound(A) Then
j = 0
End If
End Sub
已经运行通过,不过事先你得在桌面建立一个文本文件,用来存储数据,呵呵
求一个随机抽签不重复软件或.exe程序
复制一下代码,新建一个txt文件,修改后缀名为.html,将代码粘贴进去,然后保存为UTF-8格式。用浏览器打开即可。
36个数已经抽出 0 个.