当前位置:网站首页>C#函数返回多个值方法
C#函数返回多个值方法
2022-07-05 09:40:00 【小黄人软件】
方法一:直观
public (string gertec_code, string feitian_code,string part_name)getPartName(string feiTianCode)
{
if (feiTianCode.Equals("")) { return ("","",""); }
//用sn查csv获得其它数
int row = 0;
for (row = 0; row < dt.Rows.Count; row++)
{
if (dt.Rows[row][0].ToString().Equals(feiTianCode) || dt.Rows[row][1].ToString().Equals(feiTianCode))
{
return (dt.Rows[row][0].ToString(), dt.Rows[row][1].ToString(), dt.Rows[row][2].ToString());
}
}
Log("错误 在物料Excel中找不到编号:" + feiTianCode);
return ("", "", "");
}调用
//用sn查csv获得其它数
var v=getPartName(textBoxSN1.Text);
string feiTianCode = v.feitian_code;
string gertecCode = v.gertec_code;
string partName = v.part_name;类似MFC中void getPartName(CString code ,CString &outcode)
方法2:所有值封装一个类,返回类对象。
方法3:全局变量
等等。
函数直接用代理
边栏推荐
- Community group buying has triggered heated discussion. How does this model work?
- 盗版DALL·E成梗图之王?日产5万张图像,挤爆抱抱脸服务器,OpenAI勒令改名
- 从“化学家”到开发者,从甲骨文到TDengine,我人生的两次重要抉择
- QT event filter simple case
- (1) Complete the new construction of station in Niagara vykon N4 supervisor 4.8 software
- 为什么不建议你用 MongoDB 这类产品替代时序数据库?
- Wechat applet - simple diet recommendation (3)
- Tdengine offline upgrade process
- mysql80服务不启动
- ArcGIS Pro 创建要素
猜你喜欢

Idea debugs com intellij. rt.debugger. agent. Captureagent, which makes debugging impossible

Cut off 20% of Imagenet data volume, and the performance of the model will not decline! Meta Stanford et al. Proposed a new method, using knowledge distillation to slim down the data set

Uncover the practice of Baidu intelligent testing in the field of automatic test execution

【C语言】动态内存开辟的使用『malloc』

Community group buying has triggered heated discussion. How does this model work?
![[system design] index monitoring and alarm system](/img/83/81534fa31b525c4c7b3175d8312808.png)
[system design] index monitoring and alarm system

Cent7 Oracle database installation error

Windows uses commands to run kotlin

能源势动:电力行业的碳中和该如何实现?

MySQL character type learning notes
随机推荐
Resolve the horizontal (vertical) sliding conflict between viewpager and WebView
The king of pirated Dall · e? 50000 images per day, crowded hugging face server, and openai ordered to change its name
Roll up, break through 35 year old anxiety, and animate the CPU to record the function call process
The most comprehensive promotion strategy: online and offline promotion methods of E-commerce mall
oracle 多行数据合并成一行数据
TDengine 离线升级流程
Uncover the practice of Baidu intelligent testing in the field of automatic test execution
Roll up, break 35 - year - old Anxiety, animation Demonstration CPU recording Function call Process
How to implement complex SQL such as distributed database sub query and join?
历史上的今天:第一本电子书问世;磁条卡的发明者出生;掌上电脑先驱诞生...
The writing speed is increased by dozens of times, and the application of tdengine in tostar intelligent factory solution
卷起來,突破35歲焦慮,動畫演示CPU記錄函數調用過程
Viewpager pageradapter notifydatasetchanged invalid problem
Officially launched! Tdengine plug-in enters the official website of grafana
Data visualization platform based on template configuration
Cerebral Cortex:有向脑连接识别帕金森病中广泛存在的功能网络异常
. Net delay queue
idea用debug调试出现com.intellij.rt.debugger.agent.CaptureAgent,导致无法进行调试
What are the advantages of the live teaching system to improve learning quickly?
QT realizes signal transmission and reception between two windows