问题描述
好吧,我是编程新手,遇到了一个问题:
Ok I am new to programming and am having an issue:
我被发送了一个dll文件来创建一个接口.该dll能够从文本文件读取.我有一些方法可以读取每个文件中的数据.
I was sent a dll file to create an interface. This dll is able to read from text files. I have some methods that are able to read the data from each file.
我知道如何从方法中获取每个数据.如果我只提取一个文件,那会很好,很花哨.问题是我需要从多个文件中提取数据.
I know how to get each piece of data from the methods. That would be fine and dandy if I was only pulling in one file. The problem is that there are multiple files I need to pull data from.
下面,我能够从文件中提取数据,但是当另一个文件正在加载和读取时,我将这些数据放在哪里?我需要有一个放置数据的地方,以便可以在表单上存储和查看数据.
Below I am able to pull data from the files, but where would i put this data while another file is being loaded and read. I need to have a place to put the data so that it can be stored and viewed on a form.
很抱歉,对此我还是很陌生.感谢您的帮助.
I am sorry and am very new to this any help would be appreciated.
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Multiselect = true;
if (ofd.ShowDialog() == true)
{
var files = ofd.FileNames;// stores names of multiple files selected
autdl = new AUTDataList();//instantiates class
autdl.readHowlandMeasDataFiles(files);//reads multiple files and stores them
int num = autdl.NoAUTDataSets;//gives the number of files
for (int i = 0; i < num; i++)//increments and counter is the index for {
var sf = autdl.getAUTData(i);//this method getAUTData(i)
var deltaTheta = sf.A1Inc; //sf allows me to to get data
var deltaPhi = sf.A2Inc;
var thetaStart = sf.A1Start;
var thetaStop = sf.A1Stop;
var phiStart = sf.A2Start;
var phiStop = sf.A2Stop;
var thetaPos = sf.Axis1_Lin;
var phiPos = sf.Axis2_Lin;
}
}
}
推荐答案
我觉得您正在按顺序打开许多文件,
I feel that you are working on lot of files by sequentially opening them,
从中处理一些数据...产生一些新数据
processing some data from it... resulting in some new Data
您的问题是保留生成/计算的数据
and your problem is to hold onto this data generated/computed
如果这是正确的,那么这是DataStructures的教科书示例.它们是您用来管理数据的东西.无论如何,在不考虑哲学的情况下,我建议您:
If this is right then this is the textbook example of DataStructures. They are the thing you use to manage your data. anyways, without going into philosphy I would suggest you to:
1.创建可以保存此即时数据的类/对象
1. Create Classes/Objects that can hold this On the Fly data
OR
2.使用隔离存储 以保存它
2. Use Isolate Storage to hold it
OR
3.在内存文件/内存流中使用
3. Use In Memory Files/Memory Streams
这篇关于试图弄清楚如何生成变量??我猜的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!