zoukankan      html  css  js  c++  java
  • Visual Studio International Feature Pack 2.0写一个多语言字符转换程序(二)

    修改了一下代码,支持更多语言,具体参考Visual Studio International Feature Pack 2.0类库
    InternationalNumericFormatter类
    这个类支持以下的语言:
    简体中文
    繁体中文
    日语
    韩语
    阿拉伯语
    这个类支持以下格式化字符串:
    标准格式(L):又称大写。
    普通格式(Ln):又称小写。
    货币格式(Lc):用来表示货币。
    字译格式(Lt):以数字符号字母表示数值型数据,只支持日文。
    仅支持内置数值类型,包括double, float, int, uint, long, ulong, short, ushort, sbyte, byte and decimal.
    程序2.0代码:

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using Microsoft.International.Formatters;
    using System.Globalization;
    using System.Diagnostics;


    namespace Num
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
    try
    {
    double iNum = double.Parse(this.textBox1.Text);


    this.textBox2.Text = InternationalNumericFormatter.FormatWithCulture("L", iNum, null, new CultureInfo("zh-CN"));

    this.textBox3.Text = InternationalNumericFormatter.FormatWithCulture("L", iNum, null, new CultureInfo("zh-TW"));

    this.textBox4.Text = InternationalNumericFormatter.FormatWithCulture("L", iNum, null, new CultureInfo("ja"));

    this.textBox5.Text = InternationalNumericFormatter.FormatWithCulture("L", iNum, null, new CultureInfo("ko"));

    this.textBox6.Text = InternationalNumericFormatter.FormatWithCulture("L", iNum, null, new CultureInfo("ar"));
    }

    catch (Exception error)
    {
    MessageBox.Show(error.ToString());
    }

    }

    private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
    {
    Process.Start(
    "IExplore.exe", "http://www.wowpc.cn/thread-13910-1-1.html");
    }

    }
    }

    测试图:

    程序下载:
    http://www.wowpc.cn/thread-13916-1-1.html

  • 相关阅读:
    Git安装配置
    Openstack 错误日志查看方法
    keystone v3.0与2.0的区别
    Python远程调试Openstack
    openstack遇到的错误
    特别翔实的adaboost分类算法讲解 转的
    h5 html5 模拟时钟 页面
    js 面向对象 jquery 全局变量 封装
    HTML5 h5 微信 浮层 提示 点击右上角,从浏览器打开 pop.png
    jquery中ajax使用error调试错误的方法,实例分析了Ajax的使用方法与error函数调试错误的技巧
  • 原文地址:https://www.cnblogs.com/wangbin5542/p/1731618.html
Copyright © 2011-2022 走看看