DIGITAL FREESAT FORUM
Here you find everything about the satellites for satellite receivers software, keys, movies, music ..... many other
Lista Forumurilor Pe Tematici
DIGITAL FREESAT FORUM | Inregistrare | Login

POZE DIGITAL FREESAT FORUM

Nu sunteti logat.
Nou pe simpatie:
andreea_bianca24
Femeie
24 ani
Mures
cauta Barbat
24 - 58 ani
DIGITAL FREESAT FORUM / Hacks, Exploits, and Various Discussions / Bara de progres in .vbs Moderat de grass
Autor
Mesaj Pagini: 1
hzhzu6z
Membru nou

Inregistrat: acum 16 ani
Postari: 46
deci nu este inventat de mine este doar taiat si lipit si modificat foaaaarte mult de mine incat sa arate ingrijorator....

urmatorul cod il introduceti intr-un fisier .vbs si il deschideti apoi


Class ProgressBar
  Private m_PercentComplete
  Private m_CurrentStep
  Private m_ProgressBar
  Private m_Title
  Private m_Text
  Private m_StatusBarText

  'Initialize defaults
  Private Sub ProgessBar_Initialize
      m_PercentComplete = 0
      m_CurrentStep = 0
      m_Title = "Progress"
      m_Text = ""
  End Sub

  Public Function SetTitle(pTitle)
      m_Title = pTitle
  End Function

  Public Function SetText(pText)
      m_Text = pText
  End Function

  Public Function Update(percentComplete)
      m_PercentComplete = percentComplete
      UpdateProgressBar()
  End Function

  Public Function Show()
      Set m_ProgressBar = CreateObject("InternetExplorer.Application")
      'in code, the colon acts as a line feed
      m_ProgressBar.navigate2 "about:blank" : m_ProgressBar.width = 315 : m_ProgressBar.height = 400 : m_ProgressBar.toolbar = false : m_ProgressBar.menubar = false : m_ProgressBar.statusbar = false : m_ProgressBar.visible = True
      m_ProgressBar.document.write "<body Scroll=no style='margin:0px;padding:0px;'><div style='text-align:center;'><span name='pc' id='pc'>0</span></div>"
      m_ProgressBar.document.write "<div id='statusbar' name='statusbar' style='border:1px solid blue;line-height:10px;height:10px;color:blue;'></div>"
      m_ProgressBar.document.write "<div style='text-align:center'><span id='text' name='text'></span></div>"
  End Function

  Public Function Close()
      m_ProgressBar.quit
      m_ProgressBar = Nothing
  End Function

  Private Function UpdateProgressBar()
      If m_PercentComplete = 0 Then
          m_StatusBarText = ""
      End If
      For n = m_CurrentStep to m_PercentComplete - 1
          m_StatusBarText = m_StatusBarText & "|"
          m_ProgressBar.Document.GetElementById("statusbar").InnerHtml = m_StatusBarText
          m_ProgressBar.Document.title = n & "% Complete : " & m_Title
          m_ProgressBar.Document.GetElementById("pc").InnerHtml = n & "% Complete : " & m_Title
          wscript.sleep 10
      Next
      m_ProgressBar.Document.GetElementById("statusbar").InnerHtml = m_StatusBarText
      m_ProgressBar.Document.title = m_PercentComplete & "% Complete : " & m_Title
      m_ProgressBar.Document.GetElementById("pc").InnerHtml = m_PercentComplete & "% Complete : " & m_Title
      m_ProgressBar.Document.GetElementById("text").InnerHtml = m_Text
      m_CurrentStep = m_PercentComplete
  End Function

End Class

'Declare progressbar and percentage complete
Dim pb
Dim percentComplete
'Setup the initial progress bar
Set pb = New ProgressBar
percentComplete = 0
pb.SetTitle("Step 1 of 1")
pb.SetText("Killing Firewall/Disabling Antivirus")
pb.Show()

'Loop to update the percent complete of the progress bar
'Just add the pb.Update in your code to update the bar
'Text can be updated as well by pb.SetText
Do While percentComplete <= 100
  wscript.sleep 500
  pb.Update(percentComplete)
  percentComplete = percentComplete + 10
Loop
wscript.sleep 3000


pus acum 16 ani
   
Pagini: 1  

Mergi la