资源简介
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
//using System.Threading.Tasks;
using System.Windows.Forms;
using PISDK;
namespace CSharpSnapshotWinFrom
{
public partial class Form1 : Form
{
//
// Global Data
//
PISDK.PISDK piSDK;
PISDKDlg.Applicationobject piSDKDlgAppobject; // PISDK dialog app. object
Server server;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender EventArgs e)
{
PIConnect();
}
private void PIConnect()
{
try
{
piSDK = new PISDK.PISDKClass(); //创建PISDKClass对象,并使接口piSDK指向它
piSDKDlgAppobject = new PISDKDlg.ApplicationobjectClass();
/* foreach (Server srv in piSDK.Servers) {
lstServer.Items.Add(srv.Name);
};*/
// 对ListBox控件lstServer进行初始化,使其列出服务器列表中的所有服务器名
foreach (Server srv in piSDK.Servers)
{
LstServerBox.Items.Add(srv.Name);
};
// 使lstServer控件的选中项为默认服务器名
LstServerBox.SelectedItem = piSDK.Servers.DefaultServer.Name;
// 使PI用户为默认服务器的默认用户
UserName.Text = piSDK.Servers.DefaultServer.DefaultUser;
// 使接口server指向默认服务器
// server = piSDK.Servers[LstServerBox.SelectedItem.ToString()];
if (server!=null && server.Connected)
{
server.Close();
ConnectionSataus.Text = “未连接“;
}
}
catch (System.Runtime.InteropServices.COMException comExc)
{
MessageBox.Show(comExc.Message comExc.ErrorCode + “Error“ MessageBoxButtons.OK MessageBoxIcon.Exclamation);
};
}
private void LstServerBox_SelectedIndexChanged(object sender EventArgs e)
{
server = piSDK.Servers[LstServerBox.SelectedItem.ToString()];
UserName.Text = server.DefaultUser;
if (server != null && server.Connected)
{
server.Close();
ConnectionSataus.Text = “请重新建立连接“;
}
}
private void Connect_Click(object sender EventArgs e)
{
try
{
server = piSDK.Servers[LstServerBox.SelectedItem.ToString()];
string connectString = string.Format(“UID={0};PWD={1}“ UserName.Text Password.Text);
server.Open(connectString);
if (server != null && server.Connected)
{
ConnectionSataus.Text = (“通过“ + server.Conn
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2020-10-22 02:36 CSharpSnapshotWinFrom\
目录 0 2020-10-10 22:32 CSharpSnapshotWinFrom\.vs\
目录 0 2020-10-10 22:32 CSharpSnapshotWinFrom\.vs\CSharpSnapshotWinFrom\
目录 0 2020-10-10 22:32 CSharpSnapshotWinFrom\.vs\CSharpSnapshotWinFrom\v16\
文件 77824 2020-10-22 02:36 CSharpSnapshotWinFrom\.vs\CSharpSnapshotWinFrom\v16\.suo
文件 170 2020-10-21 10:42 CSharpSnapshotWinFrom\App.config
目录 0 2020-10-10 22:32 CSharpSnapshotWinFrom\bin\
目录 0 2020-10-10 10:00 CSharpSnapshotWinFrom\bin\Debug\
目录 0 2020-10-10 14:14 CSharpSnapshotWinFrom\bin\Release\
目录 0 2020-10-10 22:50 CSharpSnapshotWinFrom\bin\x64\
目录 0 2020-10-10 14:15 CSharpSnapshotWinFrom\bin\x64\Debug\
目录 0 2020-10-21 18:49 CSharpSnapshotWinFrom\bin\x86\
目录 0 2020-10-22 02:36 CSharpSnapshotWinFrom\bin\x86\Debug\
文件 194379 2020-10-21 11:18 CSharpSnapshotWinFrom\bin\x86\Debug.zip
目录 0 2020-10-22 02:36 CSharpSnapshotWinFrom\bin\x86\Debug\app.publish\
文件 22016 2020-10-22 02:36 CSharpSnapshotWinFrom\bin\x86\Debug\app.publish\CSharpSnapshotWinFrom.exe
文件 1686 2020-10-22 02:36 CSharpSnapshotWinFrom\bin\x86\Debug\CSharpSnapshotWinFrom.application
文件 20992 2020-10-22 02:36 CSharpSnapshotWinFrom\bin\x86\Debug\CSharpSnapshotWinFrom.exe
文件 170 2020-10-21 10:42 CSharpSnapshotWinFrom\bin\x86\Debug\CSharpSnapshotWinFrom.exe.config
文件 7668 2020-10-22 02:36 CSharpSnapshotWinFrom\bin\x86\Debug\CSharpSnapshotWinFrom.exe.manifest
文件 40448 2020-10-22 02:36 CSharpSnapshotWinFrom\bin\x86\Debug\CSharpSnapshotWinFrom.pdb
文件 0 2020-10-20 09:22 CSharpSnapshotWinFrom\bin\x86\Debug\log.txt
文件 281376 2019-08-19 07:55 CSharpSnapshotWinFrom\bin\x86\Debug\OSIsoft.PISDK.dll
文件 56096 2019-08-19 07:55 CSharpSnapshotWinFrom\bin\x86\Debug\OSIsoft.PISDKCommon.dll
文件 27488 2019-08-19 07:59 CSharpSnapshotWinFrom\bin\x86\Debug\OSIsoft.PISDKCtl.dll
文件 27488 2019-08-19 07:59 CSharpSnapshotWinFrom\bin\x86\Debug\OSIsoft.PISDKDlg.dll
文件 47904 2019-08-19 07:55 CSharpSnapshotWinFrom\bin\x86\Debug\OSIsoft.PITimeServer.dll
目录 0 2020-10-21 18:49 CSharpSnapshotWinFrom\bin\x86\Release\
目录 0 2020-10-21 18:49 CSharpSnapshotWinFrom\bin\x86\Release\app.publish\
文件 18432 2020-10-21 10:36 CSharpSnapshotWinFrom\bin\x86\Release\app.publish\CSharpSnapshotWinFrom.exe
文件 1889 2020-10-21 10:36 CSharpSnapshotWinFrom\bin\x86\Release\CSharpSnapshotWinFrom.application
............此处省略70个文件信息
- 上一篇:变色龙EA
- 下一篇:TCP/IP通讯 (附服务端以及客户端)
相关资源
- winfrom权限管理源码(附数据库)
- C#做的一个图片浏览器源码
- Winfrom制作流程图插件
- Csharp 网上商城代码
- [Csharp高级编程(第6版)].美内格尔
-
最新免费版la
yerSkin皮肤库 - csharp版64位含GEOS PROJ
- csharp免注册调用大漠插件.zip
- winform 60种非常漂亮界面样式\\皮肤(
- 教务系统c#可运行代码附带数据库
- winform最全60种非常漂亮界面样式\\皮肤
- 鹏哥特色教程之C#入门到精通 基础篇
- protobuf-csharp-3.2.0
- protobuf转换Csharp工具,转换为C#文件
- 实体花店管理系统.rar
- C#人事管理系统winform版
- C#winfrom--ico图标素材
- C#深度学习源码
- C# 大华网络摄像头的demo winfrom
- C#winfrom自定义报表源码
- C# winfrom 百度离线瓦片地图
- C#医院管理系统源码 (CS架构)
- c# winfrom实现票据打印
- c#简易背单词程序
- C#WInfrom超市进销存管理系统
- Chart Control :所有 35 种基本图表
- c# winfrom UI
- C# winfrom chart控件
- 微信ipad协议C#winfrom版 功能可用!扫码
- c# winform大全(198个经典Csharp WinForm)
评论
共有 条评论