السلام عليكم ورحمة الله وبركاته
بالنسبة لسؤالك الاول الدالة remove للدوال النصية تقوم بازالة حروف من المتغير النصي
كود :
Remove(startIndex As integer ,count as integer) as string
تاخذ بارمترين الاول startIndex وهو رقم الترتيب للحرف المراد ازالته من الجملة
Count عدد الحروف المراد حذفها بعد البارميتر الاول
لاحظ الكود التالي يقوم بحذف الحرف ال3 وال4
كود :
TextBox1.Text = TextBox1.Text.Remove(2, 2) 'الرقم الاول ترتيب الحرف ويبدأ الترتيب من الصفر
بالنسبة لسؤالك الثاني كيف ياريت اخي تحدد نوع للطريقة الي تريدها للتنقل
سؤالك الثالث
ضع زر بوتون وواحد listbox
وجرب هذا الكود
كود :
Imports Microsoft.Win32
Imports System
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
NETOneToFour()
End Sub
Private Sub NETOneToFour()
Using netKey As RegistryKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey("SOFTWARE\Microsoft\NET Framework Setup\NDP\")
For Each versionKeyName In netKey.GetSubKeyNames()
If versionKeyName = "v4" Then
Continue For
End If
If versionKeyName.StartsWith("v") Then
Dim verKey As RegistryKey = netKey.OpenSubKey _
(versionKeyName)
Dim strVer = CStr(verKey.GetValue("Version", ""))
Dim strServicePack = verKey.GetValue("SP", "") _
.ToString()
Dim strInstalled = verKey.GetValue("Install", "") _
.ToString()
If String.IsNullOrEmpty(strInstalled) Then
ListBox1.Items.Add("{versionKeyName} {strVer}")
Else
If Not (String.IsNullOrEmpty(strServicePack)) _
AndAlso strInstalled = "1" Then
ListBox1.Items.Add("{versionKeyName}{strVer} Service Pack{strServicePack}")
End If
End If
If Not String.IsNullOrEmpty(strVer) Then
Continue For
End If
For Each strSubKeys In verKey.GetSubKeyNames()
Dim subKey As RegistryKey = verKey.OpenSubKey _
(strSubKeys)
strVer = CStr(subKey.GetValue("Version", ""))
If Not String.IsNullOrEmpty(strVer) Then _
strServicePack = subKey.GetValue("SP", "") _
.ToString()
strInstalled = subKey.GetValue("Install", "") _
.ToString()
If String.IsNullOrEmpty(strInstalled) Then
listBox1.Items.Add("{versionKeyName}{strVer}")
Else
If Not (String.IsNullOrEmpty(strServicePack)) _
AndAlso strInstalled = "1" Then
ListBox1.Items.Add("{strSubKeys} {strVer}Service Pack{strServicePack}")
ElseIf strInstalled = "1" Then
ListBox1.Items.Add(" {strSubKeys}{strVer}")
End If
End If
Next
End If
Next
End Using
End Sub
End Class