Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub SaveSourceCode(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveCode.Click
- ShowBusy("Saving the source code...")
- If My.Settings.DefaultOutputFolder Is String.Empty Then
- My.Settings.DefaultOutputFolder = Application.StartupPath & "\output\"
- My.Settings.Save()
- End If
- With Me.SaveCodeDialog
- .InitialDirectory = My.Settings.DefaultOutputFolder
- .FileName = Me.cmbLanguage.Text
- If .ShowDialog(Me) = Windows.Forms.DialogResult.OK Then
- Try
- File.WriteAllText(.FileName, ResultCode)
- Try
- Process.Start(.FileName)
- Catch ex As Exception
- End Try
- MessageBox.Show("The code is saved succecfully", "AfterCopy3.0", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1)
- Catch ex As Exception
- MessageBox.Show("the code source could not be saved in this location", "AfterCopy3.0", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)
- End Try
- End If
- End With
- ShowToolBar(ExportToolBar)
- End Sub
Add Comment
Please, Sign In to add comment