最近在学习C#,想写windos的软件,了解了一圈,然后就入手开始学习C#,感觉C#还是很容易实现一些windos平台的小工具。
[C#] 纯文本查看 复制代码 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TaxCalc
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int price;
bool successA = int.TryParse(this.textBox1.Text, out price);
float interestRate;
bool successB = float.TryParse(this.textBox2.Text, out interestRate);
if (successA && successB)
{
float liv = (float)(price * interestRate) / 365;
this.textBox3.Text = liv.ToString();
}else {
this.textBox3.Text = "格式错误!";
}
}
}
}
源码地址:https://ide.lanzoum.com/b00rxfiti
密码: 3u69 |