【解決方法】JavaScript コードを vb.net コードに変換する方法

プログラミングQA


やあ、

1つのソフトウェアでスキャンコードを書かなければなりません。 しかし、そのソフトウェアではJavaScriptで例が示されていましたが、そのコードをvb.netで欲しいのです
利用できるツールがあれば教えてください

解決策 1

その質問は意味がありません。 言語の概念と対象はまったく異なります。 あるものから別のものへの賢明なマッピングはありません。 あなたが話している有効なツールは存在しません。 これは作るのが難しいからではなく、その機能が意味をなさないからです。

もしかしたら、何か特別な目標を念頭に置いているかもしれません。 それが何であるかを説明すれば、おそらく有益なアドバイスが得られるでしょう。

-SA

解決策 3

XML
<html>

<head>
<title>Linear Congruences</title>

<script language="JavaScript">

function Find_Solutions (f) {
    var a,b,m,d,display

    f.out.value = ""
    display = ""
    wait = ""
    m = f.m.value - 0
    a = f.a.value % m - 0
     if (a < 0) { a = a + m }
    b = f.b.value % m - 0
     if (b < 0) { b = b + m }
    d = gcd(a,m)

    if (b % d != 0) {
        f.out.value = "No solutions"
        return
    }

    for (x = 0; (a*x - b) % m != 0; x++) {
        if (x % 1000 == 0) {
            wait = wait + ". "
            f.out.value = wait
        }
    }
    display = display + x
    for (i = 1; i < d; i++) {
        display = display + ", " + (x + i*(m/d))
    }

    f.out.value = display
}

function gcd (a,b) {
    var a,b
    while (b != 0) {
        r = a % b
        a = b
        b = r
    }
    return(Math.abs(a))
}

</script>

</head>

<body BGCOLOR="cornsilk">

<center>
<big>Linear Congruences</big>
<p>

<form>
An equation of the form <B>ax</B> = <B>b</B> (mod <B>m</B>) is called a linear congruence.<br>
Enter values for <B>a</B>, <B>b</B>, and <B>m</B> below, and this program will find all the solutions.
<p>

<input type=text size=5 name="a" value="2" maxlength=5><font size=+1> x = </font>
<input type=text size=5 name="b" value="4" maxlength=5> <font size=+1>(mod</font>
<input type=text size=5 name="m" value="10" maxlength=5><font size=+1>)</font>

<p>
<input type=button value="Find Solutions" onClick="Find_Solutions(this.form)">
<p>
<table border=0><tr>
  <td valign=top><B>x</B> =</td>
  <td>
    <textarea rows=10 cols=20 name="out" wrap>
    </textarea>
  </td>
</tr></table>
</form>

</center>

<br><br><br>Back to the cryptology <a href="syllabus.html">syllabus</a>.<br><br>

</body>

</html>

解決策 4

C#
function fn_NSC_Total() {

            var dtDOP = null, fAmt, accIntrst = null;
            var fTotal = 0;

            for (var iCtr = 1; iCtr <= 10; iCtr++) {
                dtDOP = document.getElementById("txtNwValDOP_" + iCtr).value;
                //alert(dtDOP);
                fAmt = document.getElementById("txtNwValAmtRs_" + iCtr).value;
                //alert(fAmt);
                if (dtDOP != '') {
                    accIntrst = document.getElementById("txtNwValACC_Int_" + iCtr);
                    //alert(accIntrst);
                    //alert(fn_calcAccIntrest(dtDOP, fAmt));
                    accIntrst.value = roundNumber(fn_calcAccIntrest(dtDOP, fAmt), 2);
                    fTotal = parseFloat(fTotal) + parseFloat(accIntrst.value);
                }
                //alert("iCtrValue=" + iCtr);
            }
            document.getElementById("txtNewValTotal").value = roundNumber(fTotal, 2);
            //alert(document.getElementById("txtTotalErlrValues"));
            var fErlrValues = document.getElementById("txtTotalErlrValues");

            if (fErlrValues != null)
                document.getElementById("txtSubTotal").value = Math.round(parseFloat(fTotal) + parseFloat(fErlrValues.value));
            else
                document.getElementById("txtSubTotal").value = Math.round(parseFloat(fTotal));
            return false;

        }

コメント

タイトルとURLをコピーしました