Screenshot aplikasi vb,net :
Gambar diatas adalah screenshot dari aplikasi vision dimana windows app ini akan membuka aplikasi lainnya secara berurutan.
Script aplikasi ini dapat dilihat disini :
1. 'Enabling Threading'
2.
3. Imports System.Threading
4.
5. Public Class Form1
6. Dim a As New Process
7.
8. 'Make VB Apps always on top'
9. Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
10.
Dim mainScreen As Screen = Screen.FromPoint(Me.Location)
11.
Dim X As Integer = (mainScreen.WorkingArea.Width - Me.Width) / 2 + mainScreen.WorkingArea.Left
12.
Dim Y As Integer = (mainScreen.WorkingArea.Height - Me.Height) / 2 + mainScreen.WorkingArea.Top
13.
14.
Me.StartPosition = FormStartPosition.Manual
15.
Me.Location = New System.Drawing.Point(X, Y)
16.
End Sub
17.
18.
'Run the process'
19.
20.
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
21.
ProgressBar1.Increment(1)
22.
Label1.Text = ProgressBar1.Value
23.
24.
'Close VB Apps'
25.
26.
If ProgressBar1.Value = 100 Then
27.
System.Windows.Forms.Application.Exit()
28.
29.
'Opening & Configuring TIA Portal apps'
30.
31.
ElseIf ProgressBar1.Value = 3 Then
32.
CheckBox1.ForeColor = Color.Black
33.
Thread.Sleep(1000)
34.
a.StartInfo.FileName = "C:\Program Files (x86)\Siemens\Automation\Portal V12\Bin\Siemens.Automation.Portal.exe"
35.
a.Start()
36.
Thread.Sleep(8000)
37.
SendKeys.SendWait("{ENTER}")
38.
Thread.Sleep(1000)
39.
SendKeys.SendWait("%c")
40.
Thread.Sleep(8000)
41.
SendKeys.SendWait("{ENTER}")
42.
Thread.Sleep(1000)
43.
SendKeys.SendWait("{ENTER}")
44.
Thread.Sleep(10000)
45.
SendKeys.SendWait("%{F7}")
46.
Thread.Sleep(1000)
47.
SendKeys.SendWait("{TAB}")
48.
Thread.Sleep(1000)
49.
SendKeys.SendWait("{TAB}")
50.
Thread.Sleep(1000)
51.
SendKeys.SendWait("{ENTER}")
52.
Thread.Sleep(1000)
53.
SendKeys.SendWait("{TAB}")
54.
Thread.Sleep(1000)
55.
SendKeys.SendWait("{ENTER}")
56.
Thread.Sleep(1000)
57.
SendKeys.SendWait("{DOWN}")
58.
Thread.Sleep(1000)
59.
SendKeys.SendWait("{DOWN}")
60.
Thread.Sleep(1000)
61.
SendKeys.SendWait("{DOWN}")
62.
Thread.Sleep(1000)
63.
SendKeys.SendWait("{RIGHT}")
64.
Thread.Sleep(1000)
65.
SendKeys.SendWait("{DOWN}")
66.
Thread.Sleep(1000)
67.
SendKeys.SendWait("{DOWN}")
68.
Thread.Sleep(1000)
69.
SendKeys.SendWait("{DOWN}")
70.
Thread.Sleep(1000)
71.
SendKeys.SendWait("{RIGHT}")
72.
Thread.Sleep(1000)
73.
SendKeys.SendWait("{DOWN}")
74.
Thread.Sleep(1000)
75.
SendKeys.SendWait("{DOWN}")
76.
Thread.Sleep(1000)
77.
SendKeys.SendWait("{ENTER}")
78.
Thread.Sleep(7000)
79.
SendKeys.SendWait("^(t)")
80.
81.
'Opening & Configuring Intouch Wonderware 10.1 apps'
82.
83.
ElseIf ProgressBar1.Value = 28 Then
84.
CheckBox1.CheckState = 1
85.
CheckBox2.ForeColor = Color.Black
86.
Thread.Sleep(3000)
87.
a.StartInfo.FileName = "C:\Program Files (x86)\Wonderware\InTouch\intouch.exe"
88.
a.Start()
89.
Thread.Sleep(3000)
90.
SendKeys.SendWait("%c")
91.
Thread.Sleep(1000)
92.
SendKeys.SendWait("{ENTER}")
93.
Thread.Sleep(12000)
94.
SendKeys.SendWait("%c")
95.
SendKeys.SendWait("{ENTER}")
96.
97.
'Opening & Configuring Matlab 2013A apps'
98.
99.
ElseIf ProgressBar1.Value = 58 Then
100.
CheckBox2.CheckState = 1
101.
CheckBox3.ForeColor = Color.Black
102.
a.StartInfo.FileName = "C:\Program Files\MATLAB\R2013a\bin\matlab.exe"
103.
a.Start()
104.
105.
'Opening & Configuring Dassidirect apps'
106.
107.
ElseIf ProgressBar1.Value = 91 Then
108.
CheckBox3.CheckState = 1
109.
CheckBox4.ForeColor = Color.Black
110.
a.StartInfo.FileName = "C:\Program Files (x86)\Common Files\ArchestrA\aaSMC.exe"
111.
a.Start()
112.
Thread.Sleep(3000)
113.
SendKeys.SendWait("{RIGHT}")
114.
SendKeys.SendWait("{RIGHT}")
115.
SendKeys.SendWait("{RIGHT}")
116.
SendKeys.SendWait("{RIGHT}")
117.
SendKeys.SendWait("{RIGHT}")
118.
SendKeys.SendWait("{RIGHT}")
119.
SendKeys.SendWait("{RIGHT}")
120.
SendKeys.SendWait("%")
121.
SendKeys.SendWait("{RIGHT}")
122.
SendKeys.SendWait("{ENTER}")
123.
SendKeys.SendWait("{DOWN}")
124.
SendKeys.SendWait("{ENTER}")
125.
Thread.Sleep(10000)
126.
127.
End If
128.
End Sub
129.
130.
131.
End Class
0 comments:
Post a Comment