fopen (msvcrt)
Last changed: coleharrisjohnson@gmail.com-72.219.133.104

.
Summary

C# Signature:

[DllImport("msvcrt.dll", CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi, SetLastError=true)]
public static extern IntPtr fopen(String filename, String mode);
[DllImport("msvcrt.dll", CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Unicode, SetLastError=true)]
public static extern IntPtr _wfopen(String filename, String mode);

VB Signature:

<DllImport("msvcrt.dll", CallingConvention:=CallingConvention.Cdecl, CharSet:=CharSet.Ansi, SetLastError:=True)> _
Public Shared Function fopen(ByVal filename As String, ByVal mode As String) As IntPtr
End Function
<DllImport("msvcrt.dll", CallingConvention:=CallingConvention.Cdecl, CharSet:=CharSet.Unicode, SetLastError:=True)> _
Public Shared Function _wfopen(ByVal filename As String, ByVal mode As String) As IntPtr
End Function

Alternative Managed API:

System.IO.FileStream

Notes:

Use _wfopen whenever possible; fopen doesn't support Unicode.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Documentation
fopen on MSDN