| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2264 人关注过本帖
标题:求助大神,在C#编程出现如下情况,请问该如何处理?
取消只看楼主 加入收藏
Raibows6618
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2016-11-4
结帖率:0
收藏
已结贴  问题点数:20 回复次数:0 
求助大神,在C#编程出现如下情况,请问该如何处理?
图片附件: 游客没有浏览图片的权限,请 登录注册

using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NationalInstruments;
using NationalInstruments.DAQmx;


namespace DAQ_Example
{
   
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            CheckForIllegalCrossThreadCalls = false;
        }


        System.Timers.Timer timer2;



        private void button1_Click(object sender, EventArgs e)
        {


           
            timer2 = new System.Timers.Timer(100);
            timer2.AutoReset = true;
            timer2.Enabled = true;
            timer2.Elapsed += new System.Timers.ElapsedEventHandler(timer2_Elapsed);



        }


        
        void timer2_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {

               // Control.CheckForIllegalCrossThreadCalls = false;


            Task temperatureTask = new Task();
            AIChannel myAIChannel;
            myAIChannel = temperatureTask.AIChannels.CreateThermocoupleChannel(
                "Dev1/ai0",
                "Temperature",
                0,
                100,
                AIThermocoupleType.J,
                AITemperatureUnits.DegreesC,
                25
                );

            AnalogSingleChannelReader reader = new
                AnalogSingleChannelReader(temperatureTask.Stream);

                //System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;
                double analogDataIn = reader.ReadSingleSample();//出现问题的语句

                textBox1.Text = analogDataIn.ToString();
            

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }
      
    }
}
搜索更多相关主题的帖子: public false 如何 
2016-11-04 21:08
快速回复:求助大神,在C#编程出现如下情况,请问该如何处理?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019152 second(s), 12 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved