我正在尝试创建一个新文件并在其中写入二进制文件,但发生以下错误
找不到路径“C:\Users\user\Documents...\bin\Debug\data\binary\admin.bin”的一部分。
这是我的代码
Dim bw As BinaryWriter
dim pathBin As String = Application.StartupPath & "\binary"
Dim fileExist As Boolean
Try
bw = New BinaryWriter(New FileStream(pathBin & "\admin.bin", FileMode.create))
fileExist = True
Catch ex As IOException
MessageBox.Show(ex.Message & vbNewLine & "Cannot create file.")
End Try
bw.Close()