سلام.دوستان در این بخش سورس کدهای مفید + توضیحات در باره کد مورد نظر رو قرار بدید.
سورس های موجود در بخش نت فریم ورک به این بخش منتقل میشه
موفق باشید
- - - - - - - - - -
سلام
با تیکه کد زیر میشه از انتقال اطلاعات به درایو usb جلوگیری کرد
پس از قفل کردن usb یک بار سیستم عامل خود را ری استارت کنید.
کد:
Public Function LockUSB()
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\ SYSTEM\CurrentControlSet\Control\StorageDevicePoli cies\", "writeProtect", 1, Microsoft.Win32.RegistryValueKind.DWord)
End Function
اینک کد غیر فعال کردنش
کد:
Public Function UnlockUSB()
My.Computer.Registry.LocalMachine.DeleteSubKey("SY STEM\CurrentControlSet\Control\StorageDevicePolici es")
End Function
- - - - - - - - - -
تابعي براي تفريق كردن دو ماتريس:
کد:
#Region "Subtract Matrices"
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''
' Subtracts two matrices from each other, their
' dimensions should be compatible!
' Function returns the solution or errors due to
' dimensions incompatibility
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''
Public Shared Function Subtract(ByVal Mat1(,) As Double, ByVal Mat2(,) As Double) As Double(,)
Dim i, j As Integer
Dim sol(,) As Double
Dim Rows1, Cols1 As Integer
Dim Rows2, Cols2 As Integer
On Error GoTo Error_Handler
Find_R_C(Mat1, Rows1, Cols1)
Find_R_C(Mat2, Rows2, Cols2)
If Rows1 <> Rows2 Or Cols1 <> Cols2 Then
GoTo Error_Dimension
End If
ReDim sol(Rows1, Cols1)
For i = 0 To Rows1
For j = 0 To Cols1
sol(i, j) = Mat1(i, j) - Mat2(i, j)
Next j
Next i
Return sol
Error_Dimension:
Err.Raise("5007", , "Dimensions of the two matrices do not match !")
Error_Handler:
If Err.Number = 5007 Then
Err.Raise("5007", , "Dimensions of the two matrices do not match !")
Else
Err.Raise("5022", , "One or both of the matrices are null, this operation cannot be done !!")
End If
End Function
#End Region