Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
GN WebStudio - NuovoSito.vb

NuovoSito.vb

Caricato da: GN
Scarica il programma completo

  1. Imports System.Windows.Forms
  2.  
  3. Public Class NuovoSito
  4.     Public Cartella As String
  5.  
  6.     Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
  7.         If My.Computer.FileSystem.DirectoryExists(CartellaSito.Text) Then
  8.             Cartella = CartellaSito.Text & "\" & NomeSito.Text
  9.             If My.Computer.FileSystem.DirectoryExists(Cartella) = False Then
  10.                 My.Computer.FileSystem.CreateDirectory(Cartella)
  11.                 If PredefinitoIndexHtm.Checked = True Then
  12.                     My.Computer.FileSystem.WriteAllText(Cartella & "\index.htm", My.Resources.HTMLVuoto, True)
  13.                 End If
  14.                 If PredefinitoStyleCss.Checked = True Then
  15.                     My.Computer.FileSystem.WriteAllText(Cartella & "\style.css", "", True)
  16.                 End If
  17.                 If PredefinitoCartellaImages.Checked = True Then
  18.                     My.Computer.FileSystem.CreateDirectory(Cartella & "\images")
  19.                 End If
  20.                 Me.DialogResult = System.Windows.Forms.DialogResult.OK
  21.                 Me.Close()
  22.             Else
  23.                 MsgBox("La sottocartella con il nome del sito esiste già nella cartella selezionata. Modificare il nome del sito o la cartella di salvataggio.", MsgBoxStyle.Critical)
  24.             End If
  25.         Else
  26.             MsgBox("La cartella selezionata è inesistente", MsgBoxStyle.Critical)
  27.         End If
  28.     End Sub
  29.  
  30.     Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
  31.         Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
  32.         Me.Close()
  33.     End Sub
  34.  
  35.     Private Sub NuovoSito_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  36.         CartellaSito.Text = My.Computer.FileSystem.SpecialDirectories.MyDocuments
  37.     End Sub
  38.  
  39.     Private Sub btnSfogliaCartellaSito_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSfogliaCartellaSito.Click
  40.         If SelezioneCartellaSito.ShowDialog() = Windows.Forms.DialogResult.OK Then
  41.             CartellaSito.Text = SelezioneCartellaSito.SelectedPath
  42.         End If
  43.     End Sub
  44. End Class