`
明子健
  • 浏览: 574274 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

WinForm_局域网问卷调查小程序代码

    博客分类:
  • C#
阅读更多
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

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

        private void btnSubmit_Click(object sender, EventArgs e)
        {
            //调查内容可自定义
            string Desc = "        意见及建议:" + txtDesc.Text;
            string Learn = "学习主动性:";
            if (rdo11.Checked)
            {
                Learn +=rdo11.Text;
            }
            if (rdo12.Checked)
            {
                Learn += rdo12.Text;
            }
            if (rdo13.Checked)
            {
                Learn += rdo13.Text;
            }
            if (rdo14.Checked)
            {
                Learn +=rdo14.Text;
            }

            string Zuoye = "        作业完成度:";
            if (rdo11.Checked)
            {
                Zuoye += rdo21.Text;
            }
            if (rdo12.Checked)
            {
                Zuoye += rdo22.Text;
            }
            if (rdo13.Checked)
            {
                Zuoye += rdo23.Text;
            }
            if (rdo14.Checked)
            {
                Zuoye += rdo24.Text;
            }

            string Hudong = "        组员互动性:";
            if (rdo31.Checked)
            {
                Hudong  += rdo21.Text;
            }
            if (rdo32.Checked)
            {
                Hudong += rdo22.Text;
            }
            if (rdo33.Checked)
            {
                Hudong += rdo23.Text;
            }
            if (rdo34.Checked)
            {
                Hudong += rdo24.Text;
            }

            string Lijie = "        新课理解度:";
            if (rdo41.Checked)
            {
                Lijie += rdo21.Text;
            }
            if (rdo42.Checked)
            {
                Lijie += rdo22.Text;
            }
            if (rdo43.Checked)
            {
                Lijie += rdo23.Text;
            }
            if (rdo44.Checked)
            {
                Lijie += rdo24.Text;
            }

            string Xiangqing = Learn + Zuoye + Hudong + Lijie + Desc;

            string name = txtName.Text;
            //自定义文件路径
            FileStream fs = new FileStream(@"\\mingPC\e$\组员学习情况调查\" + name + ".txt", FileMode.OpenOrCreate, FileAccess.Write);
            StreamWriter sw = new StreamWriter(fs);

            sw.Write(Xiangqing);
            sw.Close();
            fs.Close();
            MessageBox.Show("提交成功,谢谢合作!");
        }

    }
}
0
6
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics