• 大小: 1.28MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-12
  • 语言: C#
  • 标签: 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;
using System.Threading;
namespace caozuoxitong
{
    public partial class Form1 : Form
    {

        public int apple = 0;
        //桔子数量
        public int orange = 0;
        //碟子水果数量
        public int plat_size = 5;
        public Boolean xianchengzhuangtai = false;//true表示有线程运行false没有线程运行
        public int diaoducishu;
        int fa = 0;
        int mo = 0;
        int so = 0;
        int da = 0;
        int jishu = 1;
        int xiangmu = 1;
        int rengong = 0;
        int zantingji = 0;
        int hengzuobiao = 360;
        Thread father;
        Thread mother;
        Thread son;
        Thread daughter;
        public Form1()
        {
            InitializeComponent();
            plat_size = Convert.ToInt32(textBox3.Text);
            diaoducishu = Convert.ToInt32(textBox1.Text);
            father = new Thread(new ThreadStart(Father));//父亲线程
            father.Start();//父亲线程开启
            mother = new Thread(new ThreadStart(Mother));//母亲线程
            mother.Start();//母亲线程开启
            son = new Thread(new ThreadStart(Son));//儿子线程
            son.Start();//儿子线程开启
            daughter = new Thread(new ThreadStart(Daughter));//女儿线程
            daughter.Start();//女儿线程开启
            timer2.Stop();//停止计时器
            listBox1.Items.Add(““);
            listBox1.Items.Add(““);
            listBox1.Items.Add(““);
            listBox1.Items.Add(“                           输入配置信息点击运行“);
        }
        private void textBox1_KeyPress(object sender KeyPressEventArgs e)
        {

            if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8)
            {
                e.Handled = true;
            }
            else
            {
                //    MessageBox.Show(“只能输入数字“);

            }
        }
        private void textBox3_KeyPress(object sender KeyPressEventArgs e)
        {

            if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8)
            {
                e.Handled = true;
            }
            else
            {
                //    MessageBox.Show(“只能输入数字“);

            }
        }
        private void timer1_Tick(object sender EventArgs e)
        {
            SystemTime.Text = System.DateTime.Now.ToString();
        }

        private void textBox2_KeyPress(object sender KeyPressEventArgs e)
        {
            //只输入数字
            if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8)
            {
                e.Handled = true;
            }
            else
            {
                //    MessageBox.Show(“只能输入数字“);

            }
        }
        //父亲线程执行函数
        public void Father()
        {
            //线程挂起
            father.Suspend();

           

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        187  2014-12-15 10:26  caozuoxitong\caozuoxitong\App.config

     文件     364544  2014-12-16 10:43  caozuoxitong\caozuoxitong\bin\Debug\caozuoxitong.exe

     文件        187  2014-12-15 10:26  caozuoxitong\caozuoxitong\bin\Debug\caozuoxitong.exe.config

     文件      42496  2014-12-16 10:43  caozuoxitong\caozuoxitong\bin\Debug\caozuoxitong.pdb

     文件      24224  2014-12-16 10:41  caozuoxitong\caozuoxitong\bin\Debug\caozuoxitong.vshost.exe

     文件        187  2014-12-15 10:26  caozuoxitong\caozuoxitong\bin\Debug\caozuoxitong.vshost.exe.config

     文件        490  2013-06-18 20:28  caozuoxitong\caozuoxitong\bin\Debug\caozuoxitong.vshost.exe.manifest

     文件       7358  2014-12-15 10:26  caozuoxitong\caozuoxitong\caouoxitong.ico

     文件       5535  2014-12-15 10:26  caozuoxitong\caozuoxitong\caozuoxitong.csproj

     文件        478  2014-12-15 10:26  caozuoxitong\caozuoxitong\caozuoxitong.csproj.user

     文件      19489  2014-12-15 10:26  caozuoxitong\caozuoxitong\Form1.cs

     文件      25080  2014-12-15 10:26  caozuoxitong\caozuoxitong\Form1.Designer.cs

     文件     504858  2014-12-15 10:26  caozuoxitong\caozuoxitong\Form1.resx

     文件       1920  2014-12-16 10:43  caozuoxitong\caozuoxitong\obj\Debug\caozuoxitong.csproj.FileListAbsolute.txt

     文件        977  2014-12-16 10:43  caozuoxitong\caozuoxitong\obj\Debug\caozuoxitong.csproj.GenerateResource.Cache

     文件       2211  2014-12-15 10:26  caozuoxitong\caozuoxitong\obj\Debug\caozuoxitong.csprojResolveAssemblyReference.cache

     文件     364544  2014-12-16 10:43  caozuoxitong\caozuoxitong\obj\Debug\caozuoxitong.exe

     文件     332873  2014-12-15 10:26  caozuoxitong\caozuoxitong\obj\Debug\caozuoxitong.Form1.resources

     文件      42496  2014-12-16 10:43  caozuoxitong\caozuoxitong\obj\Debug\caozuoxitong.pdb

     文件        180  2014-12-15 10:26  caozuoxitong\caozuoxitong\obj\Debug\caozuoxitong.Properties.Resources.resources

     文件       6848  2014-12-15 10:26  caozuoxitong\caozuoxitong\obj\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       7260  2014-12-15 10:27  caozuoxitong\caozuoxitong\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件          0  2014-12-15 10:26  caozuoxitong\caozuoxitong\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2014-12-15 10:26  caozuoxitong\caozuoxitong\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

     文件          0  2014-12-15 10:26  caozuoxitong\caozuoxitong\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

     文件        524  2014-12-15 10:26  caozuoxitong\caozuoxitong\Program.cs

     文件       1378  2014-12-15 10:26  caozuoxitong\caozuoxitong\Properties\AssemblyInfo.cs

     文件       2876  2014-12-15 10:26  caozuoxitong\caozuoxitong\Properties\Resources.Designer.cs

     文件       5612  2014-12-15 10:26  caozuoxitong\caozuoxitong\Properties\Resources.resx

     文件       1099  2014-12-15 10:26  caozuoxitong\caozuoxitong\Properties\Settings.Designer.cs

............此处省略16个文件信息

评论

共有 条评论