Guest User

Untitled

a guest
Apr 25th, 2014
55
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Sub GuardarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GuardarToolStripMenuItem.Click
  2. SaveFileDialog1.ShowDialog()
  3. If My.Computer.FileSystem.FileExists(SaveFileDialog1.FileName) Then
  4. Dim ask As MsgBoxResult
  5. ask = MsgBox("File already exists, would you like to replace it?", MsgBoxStyle.YesNo, "File Exists")
  6.  
  7. If ask = MsgBoxResult.No Then
  8. SaveFileDialog1.ShowDialog()
  9.  
  10. ElseIf ask = MsgBoxResult.Yes Then
  11. My.Computer.FileSystem.WriteAllText(SaveFileDialog1.FileName, TextBox1.Text, False)
  12. End If
  13.  
  14. Else
  15. My.Computer.FileSystem.WriteAllText(SaveFileDialog1.FileName, TextBox1.Text, False)
  16. End If
  17. End Sub
RAW Paste Data