软件功能
读取OPC,开一个TCP侦听,允许客户端通过我的软件获取OPC的数据
OPCServer是ABPLC的RSLinx,客户端是Unity3D,用OPC的dll会比较麻烦,所以自己做了个中间件
要读取的数据配置到excel表里
软件开启的时候读取excel表,然后放到datatable里
为了方便通信时关联OPC标签和值,我把值也存放在datatabl……继续阅读 »
12年前 (2014-12-14) 3161浏览 0评论
0个赞
为什么 if (mysqlReader2[0].ToString() != “0” )
这句提示:
错误 1 无法将类型“object”隐式转换为“int”。存在一个显式转换(是否缺少强制转换?)
代码如下:
connection = new MySql.Data.MySqlClient.MySqlConnection(MyConne……继续阅读 »
12年前 (2014-12-14) 3710浏览 0评论
0个赞
举个例子:如果在repeater中放一个label,label的Text是绑定数据源的,那么如和实现在绑定数据的时候,当label的Text值为“没有问题”的时候标绿(ForeColor=”Green”),Text的值为“有问题”的时候标红(ForeColor=”Red”)?
—- 10分
for……继续阅读 »
12年前 (2014-12-14) 2042浏览 0评论
0个赞
listItem.SubItems.Add(filename.Substring(0, file.Name.LastIndexOf(“.”)));
提示:索引和长度必须引用该字符串内的位置。
参数名: length
请问怎么解决啊!说的详细点,谢谢啦
—-
全部代码如下:
foreach (FileInfo file i……继续阅读 »
12年前 (2014-12-14) 2492浏览 0评论
0个赞
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
……继续阅读 »
12年前 (2014-12-14) 1766浏览 0评论
0个赞
1. 单例的目的是什么?
这个应该很明显,保证一个类只有单一的实例,也就是说你无法通过New或CreateInstance来创建这个类的一个新实例。
2. 单例的好处在哪里?
当一个对象在程序内部只能有一个实例的时候,它可以保证我们不会重复创建,而是始终指向同一个对象。
3. 怎么用?
单例模式的实现代码如下:
namespace SinglePattern……继续阅读 »
12年前 (2014-12-14) 1852浏览 0评论
0个赞
方法一:
[STAThread]
static void Main() { bool isAppRunning = false;
System.Threading.Mutex mutex = new System.Threading.Mutex(
true,
System.Diagnostics.Process.GetCu……继续阅读 »
12年前 (2014-12-14) 1724浏览 0评论
0个赞
没听懂,
长度 你可以 监听label的 width
—-
在lable的数据给定后
if(lable.Text.Length>10)
{
lable.Font.Size=…
}else if(lable.Text.Length>20)
{…}
…
—-
宽度同理
—-
不……继续阅读 »
12年前 (2014-12-14) 5724浏览 0评论
0个赞
{""Code"":1,""Message"":
[{""merchant_id"":8,""items"":[{""count"":2,""goods_name"":""商品1 汉堡包22222"",""goods_des"":""汉堡包的描述 有什么好描述的"",""goods_type"":1,""price"":19.80,""remark"……继续阅读 »
12年前 (2014-12-14) 3513浏览 0评论
0个赞