本文介绍了xdg-open和System.Diagnostics.Process的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 因为我需要一个程序来执行localblast为我们的科学研究重新设计计算机模型,所以我写了一个vb.net程序。当程序运行到启动一个进程对象的行来调用linux平台上的外部命令时,该程序给我一个例外: xieguigang @ xieguigang-HP -Compaq-8510w:〜/ Desktop / Debug $ mono ./c2.exe build -i/home/xieguigang/Desktop/8004.gbk-f gbk [c2.exe,version 1.0 .0.0] c2编译器 变量'blastbin'=/ home / xieguigang / blast / bin / 变量'blastdb'=/ home / xieguigang / blast / db / 导出GenBank文件中的所有CDS序列: /home/xieguigang/Desktop/8004.gbk 缺少方法。assembly in assembly /home/xieguigang/Desktop/Debug/Bio.Assembly.dll,输入System.Runtime.CompilerServices.ExtensionAttribute 找不到自定义attr构造函数图像:/ home / xieguigang / Desktop /Debug/Bio.Assembly.dll mtoken:0x0a00003c 数据导出到文件: /home/xieguigang/blast/db//8004.fsa\" 序列类型是蛋白质...... 调用ext用于格式化目标fasta数据库的ernal命令: / home / xieguigang / blast / bin // formatdb -i/home/xieguigang/blast/db//8004.fsa-p T xdg-open:意外选项'-i' 尝试'xdg-open --help'获取更多信息。 工作完成! 实际上输出的日志来自下面显示的代码,显然异常来自process.start()调用的行: 公开 共享 Sub FormatGBK(GBK As String ,可选已保存为 字符串 = ,可选 FileType As FASTATypes = FASTATypes.Protein) Dim Process As System.Diagnostics.Process = 新 System.Diagnostics.Process() 如果 FileType = FASTATypes.Protein 然后 Printfn( 从GenBank文件导出所有CDS序列:\ n \'%s \',GBK) Dim FASTA 正如 字符串 = ExportAllCDS(GBK,已保存) Printfn( 数据导出到文件:\ n \'%s \',FASTA) Printfn( 序列类型是蛋白质......) Process.StartInfo = 全局 .c2.LocalBLAST.CommandLines.FormatDb(FASTA,FileType) Printfn( 调用外部命令格式化目标fasta数据库:\ n \'%s \',字符串 .Format( {0} {1},Process.StartInfo.FileName,Process.StartInfo.Arguments)) Process.StartInfo.UseShellExecute = True Process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden Call Process.Start() 调用 Process.WaitForExit() Printfn( 完成工作!) ElseIf FileType = FASTATypes.Nucleotide 然后 系统tem.Diagnostics.Process对象在声明中不起作用..... 我知道xdg-open是一个应用程序在linux平台上有与vb.net中对象'System.Diagnostics.Process'相同的功能 那么如何在linux平台上处理这种情况当我使用vb.net程序调用外部命令时?解决方案 这篇关于xdg-open和System.Diagnostics.Process的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-05 17:56