02-09-16, 10:42 PM
(02-09-16, 04:35 PM)أبو عمر كتب : تجربتي على المرفقاخي العزيز
يجب عمل تنفيذي exe
وتجربته
لان في اعادة التشغيل بعد غلق البرنامج ستحتاج لمساعدة من خارج التطبيق
الكود كاملا
PHP كود :
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
Private Function GetDosPath(LongPath As String) As String
Dim s As String, i As Long
Dim PathLength As Long
i = Len(LongPath) + 1
s = String(i, 0)
PathLength = GetShortPathName(LongPath, s, i)
GetDosPath = Left$(s, PathLength)
End Function
Private Sub Command1_Click()
Open App.Path & "\soft.ini" For Output As #1
If Me.Option1.Value = True Then
Print #1, "True"
Else
Print #1, "False"
End If
Close #1
If Option1.Value = True Then: End: Else Call restart
End Sub
Sub restart()
Dim Mm As String
Mm = Replace(App.Path & "\", "", "")
Open Mm & "Restart.bat" For Output As #1
Print #1, "@echo"
Print #1, "start " & GetDosPath(Mm & App.EXEName & ".exe")
Print #1, "del " & GetDosPath(Mm & "restart.bat")
Close #1
Shell Mm & "Restart.bat"
End
End Sub
Private Sub Form_Load()
Dim tb As Integer
Open App.Path & "\soft.ini" For Input As #1
While Not EOF(1)
Input #1, StringHold
Option1.Value = StringHold
Wend
Close #1
If Option1.Value = False Then Option2.Value = True
End Sub
بالتوفيق
سوال اخير
في حال زيادة خيار ات البرنامج كيف يصبح الكود ؟؟
نامل المساعده والله يحفظكم ويرعاكم
تحياتي
إذا ضاقت بك الأحوال يوماً فَثِقْ بالواحِدِ الفَرْدِ العَلِيِّ

