Description
Use the LegalCopyright
property to get the copyright notice that applies to the file.
Declaration
aqFileVersionInfoObj.LegalCopyright(Index)
Read-Only Property | String |
aqFileVersionInfoObj | An expression, variable or parameter that specifies a reference to an aqFileVersionInfo object | |||
Index | [in] | Optional | Integer | Default value: 0 |
Applies To
The property is applied to the following object:
Parameters
The property has the following parameter:
Index
A file can contain multiple version information blocks translated in different languages. This parameter specifies a zero-based index of the desired version information translation, among those included in the file. The default value is 0, which means the default version information block. To get the total number of version information translations in a file, use the Languages
property.
Property Value
A string that holds copyright notices applicable to the file.
Remarks
If you use Python or DelphiScript, you should enclose the parameter of the LegalCopyright
property in square brackets: LegalCopyright[Index]
.
Example
The following example posts Notepad’s copyright notice to the test log:
JavaScript, JScript
function VersionInfoSample()
{
var FileName = Sys.OSInfo.WindowsDirectory + "\\notepad.exe";
var VerInfo = aqFileSystem.GetFileInfo(FileName).VersionInfo;
Log.Message("Copyright notice: " + VerInfo.LegalCopyright);
}
Python
def VersionInfoSample():
FileName = Sys.OSInfo.WindowsDirectory + "\\notepad.exe"
VerInfo = aqFileSystem.GetFileInfo(FileName).VersionInfo
Log.Message("Copyright notice: " + str(VerInfo.LegalCopyright[0]))
VBScript
Sub VersionInfoSample
Dim FileName, VerInfo
FileName = Sys.OSInfo.WindowsDirectory & "\notepad.exe"
Set VerInfo = aqFileSystem.GetFileInfo(FileName).VersionInfo
Log.Message "Copyright notice: " & VerInfo.LegalCopyright
End Sub
DelphiScript
procedure VersionInfoSample;
var FileName, VerInfo;
begin
FileName := Sys.OSInfo.WindowsDirectory + '\notepad.exe';
VerInfo := aqFileSystem.GetFileInfo(FileName).VersionInfo;
Log.Message('Copyright notice: ' + VerInfo.LegalCopyright);
end;
C++Script, C#Script
function VersionInfoSample()
{
var FileName = Sys["OSInfo"]["WindowsDirectory"] + "\\notepad.exe";
var VerInfo = aqFileSystem["GetFileInfo"](FileName)["VersionInfo"];
Log["Message"]("Copyright notice: " + VerInfo["LegalCopyright"]);
}