FileInfoExtensionsSetAlternateDataStream Method
Create or modify an alternate data stream (ADS) for the specified file, and sets the stream data.
Namespace: DevCase.Extensions.FileInfoExtensionsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[EditorBrowsableAttribute(EditorBrowsableState.Always)]
public static void SetAlternateDataStream(
this FileInfo file,
string streamName,
byte[] data
)
<ExtensionAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Always)>
Public Shared Sub SetAlternateDataStream (
file As FileInfo,
streamName As String,
data As Byte()
)
Dim file As FileInfo
Dim streamName As String
Dim data As Byte()
file.SetAlternateDataStream(streamName,
data)
public:
[ExtensionAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Always)]
static void SetAlternateDataStream(
FileInfo^ file,
String^ streamName,
array<unsigned char>^ data
)
[<ExtensionAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Always)>]
static member SetAlternateDataStream :
file : FileInfo *
streamName : string *
data : byte[] -> unit
No code example is currently available or this language may not be supported.
- file FileInfo
-
The source FileInfo.
- streamName String
-
The name of the alternate data stream.
- data Byte
-
The stream data.
In Visual Basic and C#, you can call this method as an instance method on any object of type
FileInfo. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
This is a code example.
No code example is currently available or this language may not be supported.
Dim file As New FileInfo("C:\test.txt")
file.Create()
Dim dataToWrite As Byte() = Encoding.Default.GetBytes("This is a secret text!")
file.SetAlternateDataStream("My_Stream_Name", dataToWrite)
Dim streamData As Byte() = file.GetAlternateDataStream(":My_Stream_Name")
Dim valueString As String = Encoding.Default.GetString(streamData)
Console.WriteLine(valueString)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.