Guest User

Untitled

a guest
Jan 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.28 KB | None | 0 0
  1.  Private Sub SaveSourceCode(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveCode.Click
  2.         ShowBusy("Saving the source code...")
  3.         If My.Settings.DefaultOutputFolder Is String.Empty Then
  4.             My.Settings.DefaultOutputFolder = Application.StartupPath & "\output\"
  5.             My.Settings.Save()
  6.         End If
  7.         With Me.SaveCodeDialog
  8.             .InitialDirectory = My.Settings.DefaultOutputFolder
  9.             .FileName = Me.cmbLanguage.Text
  10.             If .ShowDialog(Me) = Windows.Forms.DialogResult.OK Then
  11.                 Try
  12.                     File.WriteAllText(.FileName, ResultCode)
  13.                     Try
  14.                         Process.Start(.FileName)
  15.                     Catch ex As Exception
  16.                     End Try
  17.                     MessageBox.Show("The code is saved succecfully", "AfterCopy3.0", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1)
  18.                 Catch ex As Exception
  19.                     MessageBox.Show("the code source could not be saved in this location", "AfterCopy3.0", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)
  20.                 End Try
  21.             End If
  22.         End With
  23.             ShowToolBar(ExportToolBar)
  24.     End Sub
Add Comment
Please, Sign In to add comment