автоматизирование настроек
- schnurok
- Вопрос темы решён
-
-
спасибо за овет смастерил я через [Inputbox] но как зделат штоб он
спрашывал сразу все 3 а не по одному
и еше болшая проблема ето одно из етова текста переделывал в hех 128 бит
допустим из слова [bla --> hex:1a,8d,36,71,51,3e,02,a5] -
Из слова переделать в НЕХ или сгенерировать 128 Бит WEP Schlussel?
В первом случае просто используй функцию НЕХ(а), где а десятичное число. Второй случай сложнее. Сам заинтересовался. -
привиди пример по поводу HЕХ(а) пожалуста
hочу попробыват пойдет или нет
128 бит ето необязателно ВЕП многие софты работают с 128 бит даже жосткие диски засчишают в минимум 128 бит я знаю што ето с помошю Висуал басик возможно но я незнаю как к сожелению за каждоэ предложение буду рад -
-
hех получается но не прокатывает к сожелению нужен 128 бит клуч
-
Ну самое простое - вводи 13 знаков и получишь свой 128 Бит ключ. Только неспортивно это...
-
к сожелению ето не ппрокатит ключи все делаются автоматом или уже зделаны состоят они из 8 знаков
-
как зделат штоб етот скрипт забегал
Исходный код
Показать весь кодImports System.Security.Cryptography Imports System.Text Imports System.IO Private Function EncryptString(ByVal Value As String) As String Dim ct As ICryptoTransform Dim ms As MemoryStream Dim cs As CryptoStream Dim byt() As Byte Try ct = mCSP.CreateEncryptor(mCSP.Key, mCSP.IV) byt = Encoding.UTF8.GetBytes(Value) ms = New MemoryStream cs = New CryptoStream(ms, ct, CryptoStreamMode.Write) cs.Write(byt, 0, byt.Length) cs.FlushFinalBlock() cs.Close() Catch MessageBox.Show( _ "Schlьssel und IV mьssen zunдchst generiert werden!", _ "Abbruch") Exit Function End Try Return Convert.ToBase64String(ms.ToArray()) End Function Private Function DecryptString(ByVal Value As String) As String Dim ct As ICryptoTransform Dim ms As MemoryStream Dim cs As CryptoStream Dim byt() As Byte ct = mCSP.CreateDecryptor(mCSP.Key, mCSP.IV) byt = Convert.FromBase64String(Value) ms = New MemoryStream cs = New CryptoStream(ms, ct, CryptoStreamMode.Write) cs.Write(byt, 0, byt.Length) cs.FlushFinalBlock() cs.Close() Return Encoding.UTF8.GetString(ms.ToArray()) End Function Private Function SetEnc() As SymmetricAlgorithm If optDES.Checked Then Return New DESCryptoServiceProvider Else If optTripleDES.Checked Then Return New TripleDESCryptoServiceProvider End If End If End Function
-
Это VB.Net, Пожалуйста зарегистрируйся для просмотра данной ссылки на страницу. описание как это сделать в Visual Basic, a Пожалуйста зарегистрируйся для просмотра данной ссылки на страницу. описание от мелкософта (толковое кстати). Я попробовал все прекрасно работает.
Тебе же кстати надо было еще и формуляр с тремя полями? Так что прямая дорога к VB 2005 Express и бесплатно и с поддержкой всех виндовых библиотек, ну просто прелесть. -
да несовсем бесплатно у меня он уже гдето месяц на компе и тепер регистрацию просит у тебя эст ключик
-
Да ты что... Visual Basic 2005 Express Edition - Абсолютно бесплатная программа. У тебя может Pro стоит?
-
нет у меня експрес
Пожалуйста зарегистрируйся для просмотра данной ссылки на страницу.
-
Ты поди Studio комплектом ставил? Я просто Basic Edition поставил и все. Он бесплатный по определению, а функций в нем не намного меньше чем в Studio. Я могу сегодня его на рапиду загнать (если надо конечно).
Пожалуйста зарегистрируйся для просмотра данной ссылки на страницу. -
как зделат из етова штоб он в 128 бит делал а не в 64
Исходный код
Показать весь кодmports System Imports System.IO Imports System.Security Imports System.Security.Cryptography Imports System.Runtime.InteropServices Imports System.Text Module Module1 ' Call this function to remove the key from memory after it is used for security. <DllImport("kernel32.dll")> _ Public Sub ZeroMemory(ByVal addr As IntPtr, ByVal size As Integer) End Sub ' Function to generate a 64-bit key. Function GenerateKey() As String ' Create an instance of a symmetric algorithm. The key and the IV are generated automatically. Dim desCrypto As DESCryptoServiceProvider = DESCryptoServiceProvider.Create() ' Use the automatically generated key for encryption. Return ASCIIEncoding.ASCII.GetString(desCrypto.Key) End Function Sub EncryptFile(ByVal sInputFilename As String, _ ByVal sOutputFilename As String, _ ByVal sKey As String) Dim fsInput As New FileStream(sInputFilename, _ FileMode.Open, FileAccess.Read) Dim fsEncrypted As New FileStream(sOutputFilename, _ FileMode.Create, FileAccess.Write) Dim DES As New DESCryptoServiceProvider() 'Set secret key for DES algorithm. 'A 64-bit key and an IV are required for this provider. DES.Key = ASCIIEncoding.ASCII.GetBytes(sKey) 'Set the initialization vector. DES.IV = ASCIIEncoding.ASCII.GetBytes(sKey) 'Create the DES encryptor from this instance. Dim desencrypt As ICryptoTransform = DES.CreateEncryptor() 'Create the crypto stream that transforms the file stream by using DES encryption. Dim cryptostream As New CryptoStream(fsEncrypted, _ desencrypt, _ CryptoStreamMode.Write) 'Read the file text to the byte array. Dim bytearrayinput(fsInput.Length - 1) As Byte fsInput.Read(bytearrayinput, 0, bytearrayinput.Length) 'Write out the DES encrypted file. cryptostream.Write(bytearrayinput, 0, bytearrayinput.Length) cryptostream.Close() End Sub Sub DecryptFile(ByVal sInputFilename As String, _ ByVal sOutputFilename As String, _ ByVal sKey As String) Dim DES As New DESCryptoServiceProvider() 'A 64-bit key and an IV are required for this provider. 'Set the secret key for the DES algorithm. DES.Key() = ASCIIEncoding.ASCII.GetBytes(sKey) 'Set the initialization vector. DES.IV = ASCIIEncoding.ASCII.GetBytes(sKey) 'Create the file stream to read the encrypted file back. Dim fsread As New FileStream(sInputFilename, FileMode.Open, FileAccess.Read) 'Create the DES decryptor from the DES instance. Dim desdecrypt As ICryptoTransform = DES.CreateDecryptor() 'Create the crypto stream set to read and to do a DES decryption transform on incoming bytes. Dim cryptostreamDecr As New CryptoStream(fsread, desdecrypt, CryptoStreamMode.Read) 'Print out the contents of the decrypted file. Dim fsDecrypted As New StreamWriter(sOutputFilename) fsDecrypted.Write(New StreamReader(cryptostreamDecr).ReadToEnd) fsDecrypted.Flush() fsDecrypted.Close() End Sub Public Sub Main() 'Must be 64 bits, 8 bytes. Dim sSecretKey As String ' Get the key for the file to encrypt. ' You can distribute this key to the user who will decrypt the file. sSecretKey = GenerateKey() ' For additional security, pin the key. Dim gch As GCHandle = GCHandle.Alloc(sSecretKey, GCHandleType.Pinned) ' Encrypt the file. EncryptFile("%USERPROFILE%\MyData.txt", _ "%USERPROFILE%\Encrypted.txt", _ sSecretKey) ' Decrypt the file. DecryptFile("%USERPROFILE%\Encrypted.txt", _ "%USERPROFILE%\Decrypted.txt", _ sSecretKey) ' Remove the key from memory. ZeroMemory(gch.AddrOfPinnedObject(), sSecretKey.Length * 2) gch.Free() End Sub End Module
-
Цитата
Со слов пользователя Technolog
Если я правильно понял - юзер залогиненый и ты хочешь считать все присоединенные шары? Если правильно, то вот скрипт. Он делает еще массу лишнего, но это только для того что бы ты видел, как и что происходит. Как разберешься с принципом работы можешь все лишнее удалять.
Закомментировал почти все, думаю проблем не будет. Последняя часть - это изготовление линка.Исходный код
Показать весь кодDim fso, d, dc, s, n, pfad, strS 'User ermitteln Set fsoN = WScript.CreateObject("wscript.network") With fsoN CN = "Rechner: " & .ComputerName & vbCr UN = "User: " & .UserName & vbCr UD = "Domдne: " & .UserDomain & vbCr End With MsgBox CN & UN & UD 'Bestimmen wo die ganze gespeichert soll pfad="C:\laufwerke.bat" Set WshShell = CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") 'Datei erzeugen Set file = fso.OpenTextFile(pfad, 2, True) 'Alle Laufwerke Set dc = fso.Drives file.WriteLine("mobsync.exe /logon") file.WriteLine("cls") file.WriteLine("@echo off") file.WriteLine("echo.") file.WriteLine("echo Bitte haben Sie einwenig Geduld") file.WriteLine("echo.") file.WriteBlankLines(1) strS="" For Each d In dc 'n und s sind nur da um dir das Struktur zu zeigen n = "" s = s & d.DriveLetter & " - " & d.DriveType 'Netzwerklaufwerk finden If d.DriveType = 3 Then 'bei Netzwerklaufwerken als Name fundiert ShareName n = d.ShareName 'String fьr batch erstellen strS = "net use " & d.Driveletter & ": " & d.Sharename & " /USER:" & fsoN.UserDomain & "\" & fsoN.UserName & " /p:n" & vbCr 'String in die Batchdatei schreiben file.WriteLine(strS) ElseIf d.IsReady Then 'Namen fьr die anderen laufwerken anzeigen n = d.VolumeName End If 'String bauen s = s & " - " & n & vbCr Next MsgBox s file.WriteBlankLines(1) file.WriteLine("pause") 'Verkьpfung wird auf Desktop angelegt strDesktopPath = WshShell.SpecialFolders("Desktop") 'Verknьpfungname Set objShortcutLnk = WshShell.CreateShortcut(strDesktopPath & "\laufwerke.lnk") 'Ziel objShortcutLnk.TargetPath = pfad objShortcutLnk.Description="Verknьpfung fьr Netzwerklaufwerke" 'Speichern objShortcutLnk.Save
как мне зделат штоб ето забегало с помошю [VB6]