Zum Inhalt springen

xk4fu

Mitglieder
  • Gesamte Inhalte

    174
  • Benutzer seit

  • Letzter Besuch

Alle Inhalte von xk4fu

  1. mit start und stop gehts bei mir Private bla As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click bla = 50 Timer1.Interval = 100 Timer1.Start() End Sub Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick bla = bla - 1 If bla < 1 Then Timer1.Stop() End If Label1.Text = bla End Sub
  2. im handle wird doch auch nur ne zahl gespeichert; probier doch mal 0 aus oder einen intptr.zero oder so
  3. warning ist kein fehler; das programm läuft jetzt auch^^ du musst halt dein hwnd initialisieren; bei einem int schreibst du z.b. int i = 0;
  4. also , nachdem du eine datei gespeichert hast, sieht du ja im filename von savefiledialog, den namen und den pfad damit kannst du nach dateien eines pfades suchen: ActiveVB - VB.NET-Tipp 0023: Ordner rekursiv nach Dateien durchsuchen ansonsten, wenns ned nicht, setzt doch, CheckFileExists von savefiledialog auf true, dann ploppt automatisch ne warnung auf, wenn die datei existiert
  5. da musst du nochmal den ablauf genau beschreiben: du öffnest also den file dialog (in dem fall ploppen die eigenen dateien auf) dann gehst du in dein verzeichnis und genau in dem moment willst du prüfen, ob eine entsprechende datei bereits existiert oder nicht, quasi bevor der ordner im savefiledialog angezeigt wird, aber eben schon bereits ausgewählt wurde, oder wie aber wen du den ordner kennst, dann setzt ihn doch von vornherein, oder können die unterschiedlich sein?
  6. du kannst den pfad über InitialDirectory setzen und daraus wieder auslesen; standardmäßig ist doch der eigene dateien ordner ausgewählt aber ich denke, wenn du den pfad nicht selbst setzt, gibts auch nix zum auslesen
  7. hast mich überzeugt :floet:
  8. ja das ist klar, ich hab aber jetzt auch an einen mdicontainer gedacht über dessen menü weitere dialoge aufgerufen werden; und wenn der timer in diesem läuft, interessiert das ja die anderen dialoge nicht, oder
  9. die anwendung bleibt ja nicht im timer stehen, bzw man macht ja nicht im timer einen counter, der fünf minuten wartet: ich stells mir eher so vor: du holst dir die aktuelle uhrzeit und prüfst bei jedem timer zyklus einfach nach, ob seitdem fünf minuten vorbei sind... die anwendung selbst bliebt daher nicht stehen nachteil: ändert man im windows die uhrzeit, könnte man ein problem haben. evtl macht man aber einen zweiten timer, der fünf minuten läuft und fragt den dann ab, dann hätte man keine probleme...
  10. füg einen button in die funktion doppel klick da drauf, dann wird automatisch die onclick funktion für den button generiert; und da drin schreibst du: timer1.start
  11. selbst wenn die abfrage länger als 5 minuten dauert, kann man den timer auch so einstellen, dass er erst 5 minuten nach der letzten abfrage wieder beginnt...
  12. warum nimmst du nicht einfach einen timer her und stellst ihn auf 5 minuten
  13. ja, das is mir schon klar... ich hab ja bubble zitiert und wollte damit nur sagen, dass man einen schlüssel nicht wirklich umkehren kann
  14. wieso? du wandelst ja nicht von der md5 verschlüsselung wieder zum passwort um, sondern vergleichst die beiden schlüssel: meinetwegen legst du ein passwort namens test an md5 verschlüsselt wäre das z.b. 098f6bcd4621d373cade4e832627b4f6 und wenn du das passwort eingibst, verschlüsselt du das eingegebene passwort (test) erneut und vergleichst dann 098f6bcd4621d373cade4e832627b4f6 mit 098f6bcd4621d373cade4e832627b4f6 wenn eine verschlüsselung so leicht umkehrbar wäre, dann wäre sie doch sinnlos, oder nicht
  15. kannst du das nicht zusätzlich als md5 verschlüsselt abspeichern? dann wärs doch sicher, oder?
  16. OT: woher kommt das foo eigentlich? 4711 gibts ja z.b. auch, aber das ist klar wir könnten ja mal so eine zusammenstellung von namen/ werten erstellen, die im bereich informatik häufig verwendet werden mit hintergrund usw
  17. xk4fu

    Fragen zur MSI

    vb@rchiv · Workshops · MSI-Setup mit Visual Studio 2005/2008 5 sekunden gegoogelt
  18. 1. falsches forum (gehört in .net oder?!) 2. bitte gewöhne dir doch satzzeichen usw an 3. liefert selecteditem einen string zurück und diesen wirst du wohl in einen double stecken wollen... probier mal: select case ComboBox1.SelectedItem case "Internet Explorer" end select
  19. xk4fu

    In NamedPipe Schreiben

    habs jetzt herausgefunden: es lag am object im read- und writefile das byref und object nehm ich nun byval und nen byte array und schon klappts wunderbar
  20. xk4fu

    In NamedPipe Schreiben

    weis keiner, warum ich aus dem readfile nix zurückbekomme, obwohl die notwendigen zeilen gelesen werden? Public Declare Function WriteFile Lib "kernel32" ( _ ByVal hFile As Integer, _ ByRef lpBuffer As Object, _ ByVal nNumberOfBytesToWrite As Integer, _ ByRef lpNumberOfBytesWritten As Integer, _ ByRef lpOverlapped As Integer) As Integer Declare Function ReadFile Lib "kernel32" ( _ ByVal hFile As Integer, _ ByRef lpBuffer As Object, _ ByVal nNumberOfBytesToRead As Integer, _ ByRef lpNumberOfBytesRead As Integer, _ ByRef lpOverlapped As Integer) As Integer Public Declare Function CreateNamedPipe Lib "kernel32" Alias "CreateNamedPipeA" ( _ ByVal lpName As String, _ ByVal dwOpenMode As Int32, _ ByVal dwPipeMode As Int32, _ ByVal nMaxInstances As Int32, _ ByVal nOutBufferSize As Int32, _ ByVal nInBufferSize As Int32, _ ByVal nDefaultTimeOut As Int32, _ ByVal lpSecurityAttributes As Int32) As Int32 Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" ( _ ByVal lpFileName As String, _ ByVal dwDesiredAccess As Integer, _ ByVal dwShareMode As Integer, _ ByRef lpSecurityAttributes As Integer, _ ByVal dwCreationDisposition As Integer, _ ByVal dwFlagsAndAttributes As Integer, _ ByVal hTemplateFile As Integer) As Integer Private Declare Function GetFileSize Lib "kernel32" ( _ ByVal hFile As Integer, _ ByRef lpFileSizeHigh As Integer) As Integer Private Declare Function CloseHandle Lib "kernel32" ( _ ByVal hObject As Integer) As Integer Private Declare Function SetFilePointer Lib "kernel32" _ (ByVal hFile As Integer, ByVal lDistanceToMove As Integer, _ ByVal lpDistanceToMoveHigh As Integer, _ ByVal dwMoveMethod As Integer) As Integer Private Declare Function SetEndOfFile Lib "kernel32" _ (ByVal hFile As Integer) As Integer Const GENERIC_READ = &H80000000 Const GENERIC_WRITE = &H40000000 Const FILE_SHARE_READ = &H1 Const FILE_SHARE_WRITE = &H2 Const CREATE_ALWAYS = 2 Const CREATE_NEW = 1 Const OPEN_ALWAYS = 4 Const OPEN_EXISTING = 3 Const TRUNCATE_EXISTING = 5 Const FILE_ATTRIBUTE_ARCHIVE = &H20 Const FILE_ATTRIBUTE_HIDDEN = &H2 Const FILE_ATTRIBUTE_NORMAL = &H80 Const FILE_ATTRIBUTE_READONLY = &H1 Const FILE_ATTRIBUTE_SYSTEM = &H4 Const FILE_FLAG_DELETE_ON_CLOSE = &H4000000 Const FILE_FLAG_NO_BUFFERING = &H20000000 Const FILE_FLAG_OVERLAPPED = &H40000000 Const FILE_FLAG_POSIX_SEMANTICS = &H1000000 Const FILE_FLAG_RANDOM_ACCESS = &H10000000 Const FILE_FLAG_SEQUENTIAL_SCAN = &H8000000 Const FILE_FLAG_WRITE_THROUGH = &H80000000 Const MOVEFILE_REPLACE_EXISTING = &H1 Const FILE_ATTRIBUTE_TEMPORARY = &H100 Const FILE_BEGIN = 0 Structure SECURITY_ATTRIBUTES Dim nLength As Integer Dim lpSecurityDescriptor As Integer Dim bInheritHandle As Integer End Structure Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click '#### EXE 1 #### '#################################################################### Dim hPipe As Integer = CreateNamedPipe("\\.\pipe\joho", 3, 0, _ 1, 2048, 2048, 100, 0) '#################################################################### '#### EXE 2 #### '#################################################################### If CreateNamedPipe("\\.\pipe\joho", 3, 0, _ 1, 2048, 2048, 100, 0) = -1 Then Dim written As Integer Dim s As SECURITY_ATTRIBUTES Dim bByte As Byte() = System.Text.Encoding.Unicode.GetBytes("4711") Dim hFile As Integer = CreateFile( _ "\\.\pipe\joho", _ GENERIC_WRITE, _ FILE_SHARE_READ Or FILE_SHARE_WRITE, _ 0, _ OPEN_EXISTING, _ FILE_ATTRIBUTE_NORMAL Or FILE_FLAG_NO_BUFFERING, _ 0) Dim iLowF As Int64 = 0 Dim iHighF As Int64 = 0 Dim lRetFPFile = SetFilePointer(hFile, iLowF, iHighF, FILE_BEGIN) Dim ret As Integer = WriteFile( _ hFile, _ bByte, _ UBound(bByte), _ written, _ 0) CloseHandle(hFile) 'SetEndOfFile(hFile) End If '#################################################################### '#### EXE 1 #### '#################################################################### Dim readen As Integer Dim nSize As Integer = GetFileSize( _ hPipe, _ 0) Dim bByteR(nSize) As Byte Dim iLow As Int64 = 0 Dim iHigh As Int64 = 0 Dim lRetFP = SetFilePointer(hPipe, iLow, iHigh, FILE_BEGIN) Dim lReadReturn = ReadFile(hPipe, bByteR, nSize, readen, 0) Dim sText = System.Text.Encoding.Unicode.GetString(bByteR) '#################################################################### End Sub
  21. xk4fu

    In NamedPipe Schreiben

    also die laenge des zu lesenden byte arrays hab ich herausgefunden, das nix drin steht, leider noch nicht
  22. xk4fu

    In NamedPipe Schreiben

    also das lesen funzt nu wieder ned Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim lret As Integer = CreateNamedPipe("\\.\pipe\joho", 3, 0, _ 1, 2048, 2048, 100, 0) Dim written As Integer Dim s As SECURITY_ATTRIBUTES Dim bByte As Byte() = System.Text.Encoding.Unicode.GetBytes("Hello from client") Dim retcf As Integer = CreateFile( _ "\\.\pipe\joho", _ GENERIC_WRITE, _ FILE_SHARE_READ Or FILE_SHARE_WRITE, _ 0, _ OPEN_EXISTING, _ FILE_ATTRIBUTE_NORMAL Or FILE_FLAG_NO_BUFFERING, _ 0) Dim ret As Integer = WriteFile(retcf, bByte, UBound(bByte), written, 0) Dim bByteR(34) As Byte Dim readen As Integer Dim retr = ReadFile(lret, bByteR, 34, readen, 0) End Sub im retr steht 1, also hats geklappt, im readen 33, ist auch in ordnung nur im bbyter stehehn nur 0er drin und btw: woher weis ich denn, wieviel ich lesen muss?
  23. xk4fu

    In NamedPipe Schreiben

    ok merci schonmal, jetzt hab ich mein handle vom createfile und das steck ich jetzt ins writefile? weil da kommt wieder 0 zurück und bei written auch wieder 0 Dim retcf As Integer = CreateFile( _ "\\.\pipe\joho", _ GENERIC_READ, _ FILE_SHARE_READ Or FILE_SHARE_WRITE, _ 0, _ OPEN_EXISTING, _ FILE_ATTRIBUTE_NORMAL Or FILE_FLAG_NO_BUFFERING, _ 0) Dim ret As Integer = WriteFile(retcf, bByte, UBound(bByte), written, 0) edit: habs: statt GENERIC_READ --> GENERIC_WRITE
  24. xk4fu

    In NamedPipe Schreiben

    Public Declare Function WriteFile Lib "kernel32" ( _ ByVal hFile As Integer, _ ByRef lpBuffer As Object, _ ByVal nNumberOfBytesToWrite As Integer, _ ByRef lpNumberOfBytesWritten As Integer, _ ByRef lpOverlapped As Integer) As Integer Public Declare Function CreateNamedPipe Lib "kernel32" Alias "CreateNamedPipeA" ( _ ByVal lpName As String, _ ByVal dwOpenMode As Int32, _ ByVal dwPipeMode As Int32, _ ByVal nMaxInstances As Int32, _ ByVal nOutBufferSize As Int32, _ ByVal nInBufferSize As Int32, _ ByVal nDefaultTimeOut As Int32, _ ByVal lpSecurityAttributes As Int32) As Int32 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim lret As Integer = CreateNamedPipe("\\.\pipe\joho", 3, 0, _ 1, 2048, 2048, 100, 0) Dim written As Integer Dim bByte As Byte() = System.Text.Encoding.Unicode.GetBytes("Hello from client") Dim ret As Integer = WriteFile(lret, bByte, UBound(bByte), written, 0) End Sub

Fachinformatiker.de, 2024 by SE Internet Services

fidelogo_small.png

Schicke uns eine Nachricht!

Fachinformatiker.de ist die größte IT-Community
rund um Ausbildung, Job, Weiterbildung für IT-Fachkräfte.

Fachinformatiker.de App

Download on the App Store
Get it on Google Play

Kontakt

Hier werben?
Oder sende eine E-Mail an

Social media u. feeds

Jobboard für Fachinformatiker und IT-Fachkräfte

×
×
  • Neu erstellen...