資料庫抽獎
㈠ 抽獎軟體用的ACCESS資料庫,如二等獎設置有100名,怎樣防止兩台電腦同時抽獎時有可能會多一個二等獎出來.
可以抽一條就做個標記,比如中獎號碼數,再抽的時候先判斷中獎號碼個數,如果到100就不抽了
㈡ 跪求java 抽獎程序 含資料庫
35選7彩票程序
public class caipiao
{
static void generate()
{
int a[]=new int[7];
int i,m,j;
fan:for(j=0;j <7;j++){//外循環實現隨機生成每組7個數
a[j]=(int)(Math.random()*35+1);
m=a[j];
if(j>=1){
for(i=0;i <j;i++)//內循環實現無重復
if(a[i]==m){
j--;
continue fan;
}
}
if(a[j] <10)
System.out.print("0"+a[j]+" ");
else
System.out.print(a[j]+" ");
}
}
public static void main (String args[]){
int n=Integer.parseInt(args[0]);
System.out.println("中國福利彩票35選7");
for(int i=0;i <n;i++){//循環調用方法實現輸出n組數
generate();
System.out.println();
}
}
}
㈢ ASP抽獎保存到資料庫
首先抽獎,由一個隨機程序產生。把所產生的結果及手機等信息名字一起提交資料庫。即可
至於代碼,主要,也就是隨機程序代碼。我沒有現成的。