IVSSItem.Get MethodÂ
Gets a file or a project.
Namespace: Microsoft.VisualStudio.SourceSafe.Interop
Assembly: Microsoft.VisualStudio.SourceSafe.Interop (in microsoft.visualstudio.sourcesafe.interop.dll)
Syntax
'Declaration
Sub Get ( _
<InAttribute> <OutAttribute> <OptionalAttribute> Optional ByRef Local As String = "", _
<InAttribute> <OptionalAttribute> Optional iFlags As Integer = 0 _
)
'Usage
Dim instance As IVSSItem
Dim Local As String
Dim iFlags As Integer
instance.Get(Local, iFlags)
void Get (
[OptionalAttribute] [InAttribute] out string Local,
[OptionalAttribute] [InAttribute] int iFlags
)
void Get (
[InAttribute] [OutAttribute] [OptionalAttribute] String^% Local,
[InAttribute] [OptionalAttribute] int iFlags
)
void Get (
/** @attribute InAttribute() */ /** @attribute OutAttribute() */ /** @attribute OptionalAttribute() */ /** @ref */ String Local,
/** @attribute InAttribute() */ /** @attribute OptionalAttribute() */ int iFlags
)
JScript does not support passing value-type arguments by reference.
Parameters
- Local
Optional. A string representing a fully qualified local path to which you want to get a file or a project. If you get a file, the path includes the file name. The default value, null or an empty string, represents the working folder (LocalSpec ) of a file or a project.
- iFlags
Optional. The default value is 0. For more information, see VSSFlags.
Remarks
[IDL]
HRESULT Get ([in,out,defaultvalue(0)]BSTR *Local, [in,defaultvalue(0)]long iFlags);
When you get a project, you get all the files in this project regardless of their IsCheckedOut status.
Example
The following example demonstrates how to use the Get method. In this example, the file, test.txt, does not exist in the working folder or the specified folder prior to invocation of the Get method. After the successful call to the Get method, the file, test.txt, is present in both folders.
using System;
using Microsoft.VisualStudio.SourceSafe.Interop;
public class IVSSTest
{
public static void Main()
{
// Create a VSSDatabase object.
IVSSDatabase vssDatabase = new VSSDatabase();
// Open a VSS database using network name
// for automatic user login.
vssDatabase.Open(@"C:\VSSTestDB\srcsafe.ini",
Environment.UserName, "");
IVSSItem vssFile =
vssDatabase.get_VSSItem("$/TestFolder/test.txt", false);
// Get a file into a specified folder.
string testFile = @"C:\1\test.txt";
vssFile.Get(ref testFile, 0);
// Get a file into a working folder.
testFile = null;
vssFile.Get(ref testFile, 0);
Console.WriteLine("The Get operation is completed");
}
}
See Also
Reference
IVSSItem Interface
IVSSItem Members
Microsoft.VisualStudio.SourceSafe.Interop Namespace