이런프로그램도 제작이 가능활까요? > 자유게시판

자유게시판

이런프로그램도 제작이 가능활까요? 정보

이런프로그램도 제작이 가능활까요?

본문

작은창에

텍스트창 하나

버튼 두개개 있고

생성하기 버튼을 누르면 텍스트창에 랜덤으로 숫자,영어가 조합된 10자리정도 텍스트가 나오고

복사하기 버튼을 누르면 다른곳에 붙여넣기 할수있도록 복사되는방식인데

만약 제작을 한다고 하면 이런건 제작비용이 얼마나 나올까요;;?
추천
0
  • 복사

댓글 3개

<script>
function RndStr() {
    this.str = '';
    this.pattern = /^[a-zA-Z0-9]+$/;
 
    this.setStr = function(n) {
        if(!/^[0-9]+$/.test(n)) n = 0x10;
        this.str = '';
        for(var i=0; i<n-1; i++) {
            this.rndchar();
        }
    }
 
    this.setType = function(s) {
        switch(s) {
            case '1' : this.pattern = /^[0-9]+$/; break;
            case 'A' : this.pattern = /^[A-Z]+$/; break;
            case 'a' : this.pattern = /^[a-z]+$/; break;
            case 'A1' : this.pattern = /^[A-Z0-9]+$/; break;
            case 'a1' : this.pattern = /^[a-z0-9]+$/; break;
            default : this.pattern = /^[a-zA-Z0-9]+$/;
        }
    }
 
    this.getStr = function() {
        return this.str;
    }
 
    this.rndchar = function() {
        var rnd = Math.round(Math.random() * 1000);
        if(!this.pattern.test(String.fromCharCode(rnd))) {
            this.rndchar();
        } else {
            this.str += String.fromCharCode(rnd);
        }
    }
}

var rndstr = new RndStr();

rndstr.setType('a1');
rndstr.setStr(11);
document.write(rndstr.getStr() + "<br />");

rndstr.setType('A1');
rndstr.setStr(11);
document.write(rndstr.getStr() + "<br />");
</script>
© SIRSOFT
현재 페이지 제일 처음으로