写入的非脚本用于从.xls读取值

时间:2021-05-04 08:59:54

Is there anyway by which we can read a value from an .xls file using nant scripts.The nant scripts should ask the input from the user and based on the inputs the nant.build should search the .xls file and when it sees the match,it should copy the corresponding mail ID and echo that mail ID to some other file and that echoed value should be placed in the mail section of the cruise control.NET .

无论如何,我们可以使用nant脚本从.xls文件读取值。nant脚本应该询问用户的输入并根据输入nant.build应该搜索.xls文件以及何时看到匹配,它应该复制相应的邮件ID并将该邮件ID回显给其他文件,并且该回显值应该放在cruise control.NET的邮件部分中。

Please get back to me for any more clarifications

如有任何更多说明,请回复我

Thanks GNR

2 个解决方案

#1


You should write an NAnt extension. It is relatively easy to do.

你应该写一个NAnt扩展名。这样做比较容易。

See this tutorial here

在这里查看本教程

As an example project see my question here and here.

作为示例项目,请在此处和此处查看我的问题。

#2


I'll re-phrase my answer :

我会重新说出我的答案:

"Is there anyway by which we can read a value from an .xls file using nant scripts"

“无论如何,我们可以使用nant脚本从.xls文件中读取值”

If you are talking about using the 'core' NAnt functionality, which is that funcationality that is provided within the basic installation of NAnt, then I would say "No" or "Not very easily".

如果你在谈论使用'核心'NAnt功能,这是在NAnt的基本安装中提供的功能,那么我会说“不”或“不是很容易”。

You can however extend NAnt using .NET libraries to perform whatever function you want, as long as you can code that function in a .NET language.

但是,您可以使用.NET库扩展NAnt以执行您想要的任何功能,只要您可以使用.NET语言编写该功能。

So, for you to solve your problems, the steps you need to under-take in my view are :

因此,为了解决您的问题,我需要采取的步骤包括:

(a) Write a .NET library with methods that undertake the function(s) you describe

(a)编写一个.NET库,其中包含承担您描述的功能的方法

(b) Use the 'extensibility' of NAnt to turn your library in (a) into a custom task you can then call directly from your NAnt script

(b)使用NAnt的“扩展性”将(a)中的库转换为自定义任务,然后可以直接从NAnt脚本调用

Obviously, you need to be able to break your problem down so that you can code it for part (a). Once you have done that, part (b) is reasonably trivial, and the tutorial I supplied in the link should easily walk you through this.

显然,您需要能够解决问题,以便为代码(a)编写代码。一旦你完成了,部分(b)是相当简单的,我在链接中提供的教程应该很容易指导你完成这个。

#1


You should write an NAnt extension. It is relatively easy to do.

你应该写一个NAnt扩展名。这样做比较容易。

See this tutorial here

在这里查看本教程

As an example project see my question here and here.

作为示例项目,请在此处和此处查看我的问题。

#2


I'll re-phrase my answer :

我会重新说出我的答案:

"Is there anyway by which we can read a value from an .xls file using nant scripts"

“无论如何,我们可以使用nant脚本从.xls文件中读取值”

If you are talking about using the 'core' NAnt functionality, which is that funcationality that is provided within the basic installation of NAnt, then I would say "No" or "Not very easily".

如果你在谈论使用'核心'NAnt功能,这是在NAnt的基本安装中提供的功能,那么我会说“不”或“不是很容易”。

You can however extend NAnt using .NET libraries to perform whatever function you want, as long as you can code that function in a .NET language.

但是,您可以使用.NET库扩展NAnt以执行您想要的任何功能,只要您可以使用.NET语言编写该功能。

So, for you to solve your problems, the steps you need to under-take in my view are :

因此,为了解决您的问题,我需要采取的步骤包括:

(a) Write a .NET library with methods that undertake the function(s) you describe

(a)编写一个.NET库,其中包含承担您描述的功能的方法

(b) Use the 'extensibility' of NAnt to turn your library in (a) into a custom task you can then call directly from your NAnt script

(b)使用NAnt的“扩展性”将(a)中的库转换为自定义任务,然后可以直接从NAnt脚本调用

Obviously, you need to be able to break your problem down so that you can code it for part (a). Once you have done that, part (b) is reasonably trivial, and the tutorial I supplied in the link should easily walk you through this.

显然,您需要能够解决问题,以便为代码(a)编写代码。一旦你完成了,部分(b)是相当简单的,我在链接中提供的教程应该很容易指导你完成这个。