コード例 #1
0
        private static String uft()
        {
            System.Diagnostics.Process rt = System.Diagnostics.Process.GetCurrentProcess();
            long free = rt.freeMemory(), total = rt.totalMemory(), used = total - free;

            //		long max = rt.maxMemory();
            SupportClass.TextNumberFormat nf = SupportClass.TextNumberFormat.getTextNumberInstance();
            //        System.out.println("used: "+nf.format(used)+" free: "+nf.format(free)+" total: "+nf.format(total)+" max: "+nf.format(max));
            return(", used " + nf.FormatLong(used) + ", free " + nf.FormatLong(free) + ", total " + nf.FormatLong(total));            //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        }
コード例 #2
0
ファイル: MDLWriter.cs プロジェクト: carlhuth/GenXSource
 /// <summary> Formats an int to fit into the connectiontable and changes it
 /// to a String.
 ///
 /// </summary>
 /// <param name="i"> The int to be formated
 /// </param>
 /// <param name="l"> Length of the String
 /// </param>
 /// <returns>     The String to be written into the connectiontable
 /// </returns>
 private System.String formatMDLInt(int i, int l)
 {
     System.String s = "", fs = "";
     SupportClass.TextNumberFormat nf = SupportClass.TextNumberFormat.getTextNumberInstance(new System.Globalization.CultureInfo("en"));
     //UPGRADE_ISSUE: Method 'java.text.NumberFormat.setParseIntegerOnly' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javatextNumberFormatsetParseIntegerOnly_boolean'"
     //nf.setParseIntegerOnly(true);
     nf.setMinimumIntegerDigits(1);
     nf.setMaximumIntegerDigits(l);
     nf.GroupingUsed = false;
     s = nf.FormatLong(i);
     l = l - s.Length;
     for (int f = 0; f < l; f++)
     {
         fs += " ";
     }
     fs += s;
     return(fs);
 }