资源简介
单像空间后方交会C#单像空间后方交会C#单像空间后方交会C#单像空间后方交会C#

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Diagnostics;
using System.IO;
namespace qimo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private double[] data = new double[20]; //保存表中的数据
private double f = 0; //主距
private void btnFilePath_Click(object sender EventArgs e)
{
folderBrowserDialog1.ShowNewFolderButton = true;
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
string s = folderBrowserDialog1.SelectedPath + “\\“ + “RESULT.txt“;
if (s.Contains(@“\\“) == true) //解决根目录下出现如同C:\\RESULT.txt等不正确路径情况
{
s = s.Replace(@“\\“ @“\“);
}
this.textBox1.Text = s;
}
}
public static DataTable ExcelToDataTable(string strExcelFileName string strSheetName)
{
//源的定义
string strConn = “Provider=Microsoft.Jet.OLEDB.4.0;“ + “Data Source=“ + strExcelFileName + “;“ + “Extended Properties=‘Excel 8.0;HDR=NO;IMEX=1‘;“;
//Sql语句
//string strExcel = string.Format(“select * from [{0}$]“ strSheetName); 这是一种方法
string strExcel = “select * from [sheet1$]“;
//定义存放的数据表
DataSet ds = new DataSet();
//连接数据源
OleDbConnection conn = new OleDbConnection(strConn);
conn.Open();
//适配到数据源
OleDbDataAdapter adapter = new OleDbDataAdapter(strExcel strConn);
adapter.Fill(ds strSheetName);
conn.Close();
return ds.Tables[strSheetName];
}
private void btnStart_Click(object sender EventArgs e)
{
btnCheck.Enabled = false; //解算过程中不响应按键
btnExit.Enabled = false;
btnStart.Enabled = false;
this.label2.Text = “程序解算中,请稍等......“;
try
{
scale s = new scale(f data); //新建实例解算传入数据
s.makeSure(); //迭代解算
this.label2.Text = “解算完成迭代次数:“ + s.COUNT.ToString(); //显示状态
StreamWriter sw = new StreamWriter(this.textBox1.Text); //保存结果文件
sw.WriteLine(string.Format(“u={0:F9}“ s.U));
sw.WriteLine(string.Format(“w={0:F10}“ s.W));
sw.WriteLine(string.Format(“k={0:F9}“ s.K));
sw.WriteLine(string.Format(“Xs={0:F5}“ s.XS));
sw.WriteLine(string.Format(“Ys={0:F5}“ s.YS));
sw.WriteLine(string.Format(“Zs={0:F6}“ s.ZS));
sw.Close();
try //若成功则解算完成后自动打开结果文档
{
Process p = new Process();
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 189 2017-11-30 14:13 qimo\App.config
文件 19456 2017-12-14 14:43 qimo\bin\Debug\qimo.exe
文件 189 2017-11-30 14:13 qimo\bin\Debug\qimo.exe.config
文件 40448 2017-12-14 14:43 qimo\bin\Debug\qimo.pdb
文件 22984 2017-12-14 15:22 qimo\bin\Debug\qimo.vshost.exe
文件 189 2017-11-30 14:13 qimo\bin\Debug\qimo.vshost.exe.config
文件 490 2010-03-17 22:39 qimo\bin\Debug\qimo.vshost.exe.manifest
文件 6360 2017-12-14 14:43 qimo\Form1.cs
文件 5863 2017-12-14 14:06 qimo\Form1.Designer.cs
文件 6025 2017-12-14 14:06 qimo\Form1.resx
文件 1318 2017-12-14 14:06 qimo\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6616 2017-12-14 20:11 qimo\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 1545 2017-12-14 15:22 qimo\obj\Debug\qimo.csproj.FileListAbsolute.txt
文件 975 2017-12-14 14:26 qimo\obj\Debug\qimo.csproj.GenerateResource.Cache
文件 2231 2017-12-14 14:26 qimo\obj\Debug\qimo.csprojResolveAssemblyReference.cache
文件 19456 2017-12-14 14:43 qimo\obj\Debug\qimo.exe
文件 180 2017-12-14 14:26 qimo\obj\Debug\qimo.Form1.resources
文件 40448 2017-12-14 14:43 qimo\obj\Debug\qimo.pdb
文件 180 2017-11-30 15:06 qimo\obj\Debug\qimo.Properties.Resources.resources
文件 0 2017-11-30 14:13 qimo\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
文件 0 2017-11-30 14:13 qimo\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
文件 0 2017-11-30 14:13 qimo\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
文件 516 2017-11-30 14:13 qimo\Program.cs
文件 1346 2017-11-30 14:13 qimo\Properties\AssemblyInfo.cs
文件 2860 2017-11-30 14:13 qimo\Properties\Resources.Designer.cs
文件 5612 2017-11-30 14:13 qimo\Properties\Resources.resx
文件 1091 2017-11-30 14:13 qimo\Properties\Settings.Designer.cs
文件 249 2017-11-30 14:13 qimo\Properties\Settings.settings
文件 3825 2017-11-30 14:47 qimo\qimo.csproj
文件 7355 2017-12-14 14:06 qimo\scale.cs
............此处省略11个文件信息
相关资源
- C# TIP文件生成和拆解
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
评论
共有 条评论