Click here to Skip to main content
15,897,032 members
Articles / Desktop Programming / Win32

Volume Shadow Copies from .NET

Rate me:
Please Sign up or sign in to vote.
4.85/5 (14 votes)
7 Jan 2008Ms-PL3 min read 178.6K   3.5K   70  
Use the Windows Volume Shadow Copy service from .NET.
Option Explicit On

Imports System.Runtime.InteropServices

Public Class FindFiles


    Private Declare Function FindFirstFile Lib "kernel32.dll" Alias "FindFirstFileA" ( _
                            ByVal lpszSearchFile As String, _
                            <[In](), Out()> ByVal lpFindFileData As FileInfo.WIN32_FIND_DATA) As IntPtr

    Private Declare Function FindNextFile Lib "kernel32.dll" Alias "FindNextFileA" ( _
                            ByVal hFind As IntPtr, _
                            <[In](), Out()> ByVal lpvFindData As FileInfo.WIN32_FIND_DATA) As <MarshalAs(UnmanagedType.Bool)> Boolean

    Private Declare Function _CopyFile Lib "kernel32.dll" Alias "CopyFileA" ( _
                        ByVal lpExistingFileName As String, _
                        ByVal lpNewFileName As String, _
                        ByVal bFailIfExists As Byte) As Long

    Private Declare Function FindClose Lib "kernel32.dll" Alias "FindClose" ( _
                    ByVal hFind As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean






End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
Web Developer
United States United States
Joe is a software engineer. He lives in Pennsylvania where he develops software for manufacturing and human services when he is not at the park with his three boys.

Comments and Discussions