鱼C论坛

 找回密码
 立即注册
查看: 632|回复: 2

如果要让修改后的文件成功导入,应该怎么做?

[复制链接]
发表于 2022-12-25 17:55:13 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x

00                                nop
                                .try {
00                                nop
73 37 01 00 0A                    newobj   instance void [System.Windows.Forms]System.Windows.Forms.OpenFileDialog::.ctor()
0A                                stloc.0
06                                ldloc.0
72 11 43 00 70                    ldstr    aFileEltElt                // "File(*.elt)|*.elt"
6F 38 01 00 0A                    callvirt instance void [System.Windows.Forms]System.Windows.Forms.FileDialog::set_Filter(string)

00                                nop
06                                ldloc.0
6F 39 01 00 0A                    callvirt instance valuetype [System.Windows.Forms]System.Windows.Forms.DialogResult [System.Windows.Forms]System.Windows.Forms.CommonDialog::ShowDialog()

17                                ldc.i4.1
FE 01                             ceq
0B                                stloc.1
07                                ldloc.1
39 91 00 00 00                    brfalse  loc_7415

00                                nop
73 78 00 00 0A                    newobj   instance void [mscorlib]System.Runtime.Serialization.Formatters.Binary.BinaryFormatter::.ctor()
0C                                stloc.2
06                                ldloc.0
6F 3A 01 00 0A                    callvirt instance string [System.Windows.Forms]System.Windows.Forms.FileDialog::get_FileName()

19                                ldc.i4.3
17                                ldc.i4.1
17                                ldc.i4.1
73 3B 01 00 0A                    newobj   instance void [mscorlib]System.IO.FileStream::.ctor(string, valuetype [mscorlib]System.IO.FileMode, valuetype [mscorlib]System.IO.FileAccess, valuetype [mscorlib]System.IO.FileShare)
0D                                stloc.3
08                                ldloc.2
09                                ldloc.3
6F 3C 01 00 0A                    callvirt instance object [mscorlib]System.Runtime.Serialization.IFormatter::Deserialize(class [mscorlib]System.IO.Stream)

74 4B 00 00 02                    castclass ElitechLog.Models.Parameters
13 04                             stloc.s  4
09                                ldloc.3
6F 3D 01 00 0A                    callvirt instance void [mscorlib]System.IO.Stream::Close()

00                                nop
02                                ldarg.0
7B 3E 00 00 04                    ldfld    class [mscorlib]System.Collections.Generic.List`1<class ElitechLog.Models.Parameters> ElitechLog.MainForm::allParameters
6F 13 01 00 0A                    callvirt instance void class [mscorlib]System.Collections.Generic.List`1<class ElitechLog.Models.Parameters>::Clear()

00                                nop
02                                ldarg.0
7B 3E 00 00 04                    ldfld    class [mscorlib]System.Collections.Generic.List`1<class ElitechLog.Models.Parameters> ElitechLog.MainForm::allParameters
11 04                             ldloc.s  4
6F D2 00 00 0A                    callvirt instance void class [mscorlib]System.Collections.Generic.List`1<class ElitechLog.Models.Parameters>::Add(var<u1>)

00                                nop
02                                ldarg.0
02                                ldarg.0
7B 3E 00 00 04                    ldfld    class [mscorlib]System.Collections.Generic.List`1<class ElitechLog.Models.Parameters> ElitechLog.MainForm::allParameters
28 AB 00 00 06                    call     instance void ElitechLog.MainForm::ShowChartForm(class [mscorlib]System.Collections.Generic.List`1<class ElitechLog.Models.Parameters> parameters)

00                                nop
72 35 43 00 70                    ldstr    asc_DF318                  // "导入成功"
28 66 00 00 06                    call     string ElitechLog.T::_(string text)

28 FB 02 00 06                    call     void ElitechLog.Utils.Message::ShowInfo(string msg)

00                                nop
72 3F 43 00 70                    ldstr    a0_11                      // "导入了 {0} 条数据"
28 66 00 00 06                    call     string ElitechLog.T::_(string text)

02                                ldarg.0
7B 3E 00 00 04                    ldfld    class [mscorlib]System.Collections.Generic.List`1<class ElitechLog.Models.Parameters> ElitechLog.MainForm::allParameters
6F 36 01 00 0A                    callvirt instance int32 class [mscorlib]System.Collections.Generic.List`1<class ElitechLog.Models.Parameters>::get_Count()

8C 3F 01 00 01                    box      [mscorlib]System.Int32
28 68 00 00 0A                    call     string [mscorlib]System.String::Format(string, object)

13 05                             stloc.s  5
20 BC 0B 00 00                    ldc.i4   0xBBC
11 05                             ldloc.s  5
28 74 00 00 06                    call     void ElitechLog.logger::Info(valuetype ElitechLog.Actions action, string msg)

00                                nop
00                                nop


                              loc_7415:                               // CODE XREF: ElitechLog.MainForm__sbtnImport_Click+1F↑j
00                                nop
DE 32                             leave.s  loc_744A
                                }

                                catch [mscorlib]System.Exception {
13 06                             stloc.s  6
00                                nop
72 57 43 00 70                    ldstr    asc_DF33A                  // "导入失败"
28 66 00 00 06                    call     string ElitechLog.T::_(string text)

28 FB 02 00 06                    call     void ElitechLog.Utils.Message::ShowInfo(string msg)

00                                nop
20 BC 0B 00 00                    ldc.i4   0xBBC
72 57 43 00 70                    ldstr    asc_DF33A                  // "导入失败"
11 06                             ldloc.s  6
6F 4A 00 00 0A                    callvirt instance string [mscorlib]System.Object::ToString()

28 38 00 00 0A                    call     string [mscorlib]System.String::Concat(string, string)

28 74 00 00 06                    call     void ElitechLog.logger::Info(valuetype ElitechLog.Actions action, string msg)

00                                nop
00                                nop
DE 00                             leave.s  loc_744A
                                }


                              loc_744A:                               // CODE XREF: ElitechLog.MainForm__sbtnImport_Click+B6↑j
                                                                      // ElitechLog.MainForm__sbtnImport_Click+E8↑j
2A                                ret
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2022-12-25 18:37:02 | 显示全部楼层
      这个代码你能也能看懂?还是换 C# 或 VB.NET 吧。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-3-25 16:11:52 | 显示全部楼层
根据提供的代码,导入文件的过程似乎涉及打开一个文件对话框,选择一个扩展名为.elt的文件,反序列化文件内容,然后将结果数据添加到参数列表中。

要修改代码以成功导入文件,可能需要对以下几个方面进行更改:

文件扩展名:当前代码正在查找扩展名为.elt的文件。如果要导入的文件具有不同的扩展名,则需要相应地修改筛选器字符串。

文件格式:当前代码使用二进制格式化程序对文件内容进行反序列化。如果要导入的文件不是二进制格式,则需要使用不同的方法对文件内容进行反序列化。

数据结构:当前代码将反序列化后的数据添加到参数列表中。如果文件中的数据具有不同的结构或格式,则需要修改代码以正确解析和存储数据。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-27 06:17

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表