NativeMethods.CreateFile 方法
此类型具有 SecurityCriticalAttribute 特性,此特性将其限定为只能由 .NET Framework for Silverlight 类库在内部使用。使用此类型的任何成员的应用程序代码将引发 MethodAccessException。
命名空间: Microsoft.TeamFoundation.Common.Internal
程序集: Microsoft.TeamFoundation.Common(在 Microsoft.TeamFoundation.Common.dll 中)
语法
声明
Public Shared Function CreateFile ( _
lpFileName As String, _
dwDesiredAccess As NativeMethods.FileAccess, _
dwShareMode As NativeMethods.FileShare, _
lpSecurityAttributes As IntPtr, _
dwCreationDisposition As NativeMethods.CreationDisposition, _
dwFlagsAndAttributes As NativeMethods.FileAttributes, _
hTemplateFile As IntPtr _
) As SafeFileHandle
public static SafeFileHandle CreateFile(
string lpFileName,
NativeMethods.FileAccess dwDesiredAccess,
NativeMethods.FileShare dwShareMode,
IntPtr lpSecurityAttributes,
NativeMethods.CreationDisposition dwCreationDisposition,
NativeMethods.FileAttributes dwFlagsAndAttributes,
IntPtr hTemplateFile
)
参数
- lpFileName
类型:System.String
- dwDesiredAccess
类型:Microsoft.TeamFoundation.Common.Internal.NativeMethods.FileAccess
- lpSecurityAttributes
类型:System.IntPtr
- dwCreationDisposition
类型:Microsoft.TeamFoundation.Common.Internal.NativeMethods.CreationDisposition
- dwFlagsAndAttributes
类型:Microsoft.TeamFoundation.Common.Internal.NativeMethods.FileAttributes
- hTemplateFile
类型:System.IntPtr
返回值
类型:Microsoft.Win32.SafeHandles.SafeFileHandle