Anonymous
Anonymous asked in 電腦與網際網路程式設計 · 1 decade ago

求救~~ ASP.NET 2.0 VB語言的程式碼計算機

拜託~~有看到的高手們我極需ASP.NET 2.0 VB語言的

計算機的程式碼 拜託~~ >"<

1 Answer

Rating
  • 1 decade ago
    Favorite Answer

    您好

    因為我知識等級還不夠, 有些符號寫上來會出現亂碼 ( HTML 碼 )

    不過我有寫過一個網頁是計算機的, 放在我自己的網路空間上

    http://www.alloot.com/1.html

    開啟網頁以後, 上面有個「檢視(V)」--->「原始檔(C)」

    您就可以看到語法了

    請將下面的符號 < 和 > 改成小寫, 因為我寫上去會不見

    首先是顏色的選擇

    <STYLE type=text/css>TD {

    COLOR: #ffffff; FONT: 9pt Batang

    }

    .Button {

    BACKGROUND: #5555FF; BORDER-BOTTOM-COLOR: #003C9D; BORDER-BOTTOM-WIDTH: 2px; BORDER-LEFT-COLOR: #CCCCFF; BORDER-LEFT-WIDTH: 2px; BORDER-RIGHT-COLOR: #003C9D; BORDER-RIGHT-WIDTH: 2px; BORDER-TOP-COLOR: #CCCCFF; BORDER-TOP-WIDTH: 2px; COLOR: #ffffff; FONT: 9pt Batang; HEIGHT: 20px; MARGIN: 4px; WIDTH: 40px

    }

    .text_input {

    BACKGROUND: #CCCCFF; COLOR: #000000; FONT: 9pt Verdana, Arial, Helvetica, sans-serif; TEXT-ALIGN: right

    }

    A {

    COLOR: #ffffff; FONT: 9pt Batang

    }

    </STYLE>

    然後是整個的語法和流程部份

    <Body>

    <FORM action= name=Keypad>

    <DIV align=center>

    <CENTER>

    <TABLE bgColor=#0000FF border=1 borderColor=#CCCCFF borderColorDark=#5555FF

    borderColorLight=#CCCCFF cellPadding=0 cellSpacing=1 height=30 width=249>

    <TBODY>

    <TR>

    <TD align=middle colSpan=4>

    <P align=center><INPUT class=text_input name=ReadOut size=30 value=0

    width=100%></P></TD>

    <TD width=0> </TD>

    <TD width=50><INPUT class=Button name=btnClear onclick=Clear() type=button value= C ></TD>

    <TD><INPUT class=Button name=btnClearEntry2 onclick=ClearEntry() type=button value= CE ></TD></TR>

    <TR>

    <TD width=50><INPUT class=Button name=btnSeven onclick=NumPressed(7) type=button value= 7 ></TD>

    <TD width=50><INPUT class=Button name=btnEight onclick=NumPressed(8) type=button value= 8 ></TD>

    <TD width=50><INPUT class=Button name=btnNine onclick=NumPressed(9) type=button value= 9 >

    2008-06-12 12:12:18 補充:

    <TD width=50><INPUT class=Button name=btnHex onclick=hexchange() type=button value=HEX></TD>

    <TD width=0> </TD>

    2008-06-12 12:12:28 補充:

    <TD width=50><INPUT class=Button name=btnNeg onclick=Neg() type=button value= +/- ></TD>

    <TD><INPUT class=Button name=btnPercent onclick=Percent() type=button value= % ></TD></TR>

    2008-06-12 12:12:44 補充:

    <TR>

    <TD width=50><INPUT class=Button name=btnFour onclick=NumPressed(4) type=button value=< 4 ></TD>

    <TD width=50><INPUT class=Button name=btnFive onclick=NumPressed(5) type=button value=< 5 ></TD>

    2008-06-12 12:12:57 補充:

    <TD width=50><INPUT class=Button name=btnSix onclick=NumPressed(6) type=button value= 6 ></TD>

    <TD width=50><INPUT class=Button name=btnClearEntry222 onclick=octchange() type=button value=OCT></TD>

    <TD width=0> </TD>

    2008-06-12 12:13:11 補充:

    <TD align=middle width=50><INPUT class=Button name=btnPlus onclick=Operation('+') type=button value= + ></TD>

    <TD align=middle><INPUT class=Button name=btnMinus onclick=Operation('-') type=button value= - ></TD></TR>

    2008-06-12 12:13:26 補充:

    <TR>

    <TD width=50><INPUT class=Button name=btnOne onclick=NumPressed(1) type=button value= 1 ></TD>

    <TD width=50><INPUT class=Button name=btnTwo onclick=NumPressed(2) type=button value= 2 ></TD>

    2008-06-12 12:13:39 補充:

    <TD width=50><INPUT class=Button name=btnThree onclick=NumPressed(3) type=button value= 3 ></TD>

    <TD width=50><INPUT class=Button name=btnClearEntry23 onclick=binchange() type=button value=BIN></TD>

    <TD width=0> </TD>

    2008-06-12 12:13:54 補充:

    <TD align=middle width=50><INPUT class=Button name=btnMultiply onclick=Operation('*') type=button value= * ></TD>

    <TD align=middle><INPUT class=Button name=btnDivide onclick=Operation('/') type=button value= / ></TD></TR>

    2008-06-12 12:14:08 補充:

    <TR>

    <TD width=50><INPUT class=Button name=btnZero onclick=NumPressed(0) type=button value= 0 ></TD>

    <TD width=50><INPUT class=Button name=btnDecimal onclick=Decimal() type=button value= . ></TD>

    <TD colSpan=4 vAlign=bottom>

    2008-06-12 12:14:18 補充:

    <DIV align=center>

    <P style=MARGIN-BOTTOM: 2px> My calcuating </P></DIV></TD>

    <TD colSpan=5><INPUT class=Button name=btnEquals onclick=Operation('=') type=button value= = ></TD></TR></TBODY></TABLE></CENTER></DIV></FORM>

    2008-06-12 12:15:14 補充:

    <SCRIPT language=JavaScript>

    var FKeyPad = document.Keypad;

    var Accum = 0;

    var FlagNewNum = false;

    var PendingOp = "";

    function NumPressed (Num) {

    if (FlagNewNum) {

    FKeyPad.ReadOut.value = Num;

    FlagNewNum = false;

    }

    2008-06-12 12:15:39 補充:

    else {

    if (FKeyPad.ReadOut.value == "0")

    FKeyPad.ReadOut.value = Num;

    else

    FKeyPad.ReadOut.value += Num;

    }

    }

    function Operation (Op) {

    var Readout = FKeyPad.ReadOut.value;

    if (FlagNewNum && PendingOp != "=");

    2008-06-12 12:15:56 補充:

    else

    {

    FlagNewNum = true;

    if ( '+' == PendingOp )

    Accum += parseFloat(Readout);

    else if ( '-' == PendingOp )

    Accum -= parseFloat(Readout);

    else if ( '/' == PendingOp )

    Accum /= parseFloat(Readout);

    else if ( '*' == PendingOp )

    Accum *= parseFloat(Readout);

    2008-06-12 12:16:16 補充:

    else

    Accum = parseFloat(Readout);

    FKeyPad.ReadOut.value = Accum;

    PendingOp = Op;

    }

    }

    function Decimal () {

    var curReadOut = FKeyPad.ReadOut.value;

    if (FlagNewNum) {

    curReadOut = "0.";

    FlagNewNum = false;

    }

    2008-06-12 12:16:38 補充:

    else

    {

    if (curReadOut.indexOf(".") == -1)

    curReadOut += ".";

    }

    FKeyPad.ReadOut.value = curReadOut;

    }

    function ClearEntry () {

    FKeyPad.ReadOut.value = "0";

    FlagNewNum = true;

    }

    function Clear () {

    Accum = 0;

    PendingOp = "";

    ClearEntry();

    }

    2008-06-12 12:17:08 補充:

    function Neg () {

    FKeyPad.ReadOut.value = parseFloat(FKeyPad.ReadOut.value) * -1;

    }

    function Percent () {

    FKeyPad.ReadOut.value = (parseFloat(FKeyPad.ReadOut.value) / 100) * parseFloat(Accum);

    }

    function hexchange()

    {

    2008-06-12 12:17:33 補充:

    {

    var hex,dec;

    dec = parseFloat(FKeyPad.ReadOut.value);

    hex = dec.toString(16);

    window.alert(" Hex, H, 16:"+ hex);

    }

    function octchange()

    2008-06-12 12:17:59 補充:

    {

    var oct,dec;

    dec = parseFloat(FKeyPad.ReadOut.value);

    oct = dec.toString(8);

    window.alert(" Oct, O, 8:"+ oct);

    }

    function binchange()

    2008-06-12 12:18:34 補充:

    {

    var bin,dec;

    dec = parseFloat(FKeyPad.ReadOut.value);

    bin = dec.toString(2);

    window.alert(" Bin, B, 2:"+ bin);

    }

    </SCRIPT></Body>

    2008-06-12 12:18:53 補充:

     希望有幫到您~ ^_^ 

     

     

      

      PS. 如果再發問, 我一定會回覆和詳細說明的

    .

Still have questions? Get your answers by asking now.