当前位置:网站首页>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:全局变量
等等。
函数直接用代理
边栏推荐
- 天龙八部TLBB系列 - 关于技能冷却和攻击范围数量的问题
- How to implement complex SQL such as distributed database sub query and join?
- Tianlong Babu TLBB series - questions about skill cooling and the number of attack ranges
- Six simple cases of QT
- cent7安装Oracle数据库报错
- mysql80服务不启动
- H.265编码原理入门
- The king of pirated Dall · e? 50000 images per day, crowded hugging face server, and openai ordered to change its name
- 【C语言】动态内存开辟的使用『malloc』
- Small program startup performance optimization practice
猜你喜欢

历史上的今天:第一本电子书问世;磁条卡的发明者出生;掌上电脑先驱诞生...

tongweb设置gzip
![[C language] the use of dynamic memory development](/img/b7/3337bf0df9232d3a44eaeb46b39c63.png)
[C language] the use of dynamic memory development "malloc"

MySQL character type learning notes

The king of pirated Dall · e? 50000 images per day, crowded hugging face server, and openai ordered to change its name

移动端异构运算技术-GPU OpenCL编程(进阶篇)

. Net delay queue

oracle 多行数据合并成一行数据

【小技巧】获取matlab中cdfplot函数的x轴,y轴的数值

Understand the window query function of tdengine in one article
随机推荐
Kotlin Compose 多个条目滚动
美图炒币半年亏了3个亿,华为被曝在俄罗斯扩招,AlphaGo的同类又刷爆一种棋,今日更多大新闻在此...
高级 OpenCV:BGR 像素强度图
Viewpager pageradapter notifydatasetchanged invalid problem
Wechat applet - simple diet recommendation (4)
卷起来,突破35岁焦虑,动画演示CPU记录函数调用过程
The essence of persuasion is to remove obstacles
The most comprehensive promotion strategy: online and offline promotion methods of E-commerce mall
[C language] the use of dynamic memory development "malloc"
双容水箱液位模糊PID控制系统设计与仿真(Matlab/Simulink)
(1) Complete the new construction of station in Niagara vykon N4 supervisor 4.8 software
一文读懂TDengine的窗口查询功能
TDengine 连接器上线 Google Data Studio 应用商店
Six simple cases of QT
How to choose the right chain management software?
What should we pay attention to when entering the community e-commerce business?
How to implement complex SQL such as distributed database sub query and join?
Observation cloud and tdengine have reached in-depth cooperation to optimize the cloud experience of enterprises
To bring Euler's innovation to the world, SUSE should be the guide
Tianlong Babu TLBB series - questions about skill cooling and the number of attack ranges