[HELP] Save File Fialog/Stream Writer 02-22-2011, 10:21 PM
#1
Hi, well, I was working on a little generator and I came across a problem,
For some reason, I keep getting "Cannot acess file.php because it is allready used by another process"
thanks for any help
For some reason, I keep getting "Cannot acess file.php because it is allready used by another process"
Code:
Dim ofd, ofd2 As New SaveFileDialog
Dim SWE As Stream
ofd.Filter = "php files (*.php)|*.php|All files (*.*)|*.*"
ofd.ShowDialog()
File.Create(ofd.FileName)
SWE = ofd.OpenFile()
Using sw As StreamWriter = New StreamWriter(SWE)
sw.WriteLine("<?php")
sw.WriteLine("$action = $_GET['action'];")
sw.WriteLine("$data = $_GET['data'];")
sw.WriteLine("if ($action == " & Chr(34) & "delete" & Chr(34) & "){")
sw.WriteLine("unlink(" & Chr(34) & "log.txt" & Chr(34) & ");")
sw.WriteLine("$new = fopen(" & Chr(34) & "log.txt" & Chr(34) & ", 'a');")
sw.WriteLine("fclose($new);")
sw.WriteLine("}")
sw.WriteLine("if ($action == " & Chr(34) & "write" & Chr(34) & "){")
sw.WriteLine("$open = fopen(" & Chr(34) & "log.txt" & Chr(34) & ", 'a');")
sw.WriteLine("fwrite($open, $data." & Chr(34) & "\n" & Chr(34) & ");")
sw.WriteLine("fclose($open);")
sw.WriteLine("}")
sw.WriteLine("?>")
sw.Close()
End Usingthanks for any help
Staff will never ever ask you for your personal information.
We know everything about you anyway.
We know everything about you anyway.




![[+]](https://sinister.li/images/modern/collapse_collapsed.png)

![[Image: rytwG00.png]](http://i.imgur.com/rytwG00.png)