Zum Inhalt springen

javaanfänger

Mitglieder
  • Gesamte Inhalte

    237
  • Benutzer seit

  • Letzter Besuch

Alle Inhalte von javaanfänger

  1. Hallo zusammen, kann mir jemand sagen, wie ich mit ASP.NET zwei Werte aus einer DB auslesen kann. Die Tabelle(Login) sieht wie folgt aus: Benutzername | Passwort ------------------------- test1 | test123 test2 | test456 Ich komme im Code nicht klar. Bei anderen DB-Zugriffen fülle ich ganze Tabellen aber hier schaffe ich es nicht 2 Werte auszulesen. Vielen Dank für eure Hilfe
  2. Hallo Zusammen, kann mir bitte jemand helfen, wie ich den HttpRequest(ASP) auslesen kann? Ich benötige nämlich die IP-Adresse des Absenders, RequestTyp und die RequestMethod. <% Class myDateTime Public myDate Public myFormat 'Public myDayNames 'Public myMonthNames Public Default Function getDateTime() If isDate(myDate) Then Dim y Dim Ergebniss Ergebniss = "" Do While len(myFormat) > 0 select case left(myFormat, 1) case "d" y = 0 Do While left(myFormat, 1) = "d" myFormat = right(myFormat, len(myFormat) - 1) y = y + 1 Loop Select Case y Case 1 Ergebniss = Ergebniss & day(myDate) Case 2 if len(day(myDate)) = 1 then Ergebniss = Ergebniss & "0" end if Ergebniss = Ergebniss & day(myDate) Case 3 Ergebniss = Ergebniss & left(myDayNames(weekday(myDate)-1), 3) Case 4 Ergebniss = Ergebniss & myDayNames(weekday(myDate)-1) end select if len(myFormat) > 0 then do while left(myFormat, 1) <> "d" and left(myFormat, 1) <> "m" and left(myFormat, 1) <> "y" and left(myFormat, 1) <> "h" and left(myFormat, 1) <> "n" and left(myFormat, 1) <> "s" and len(myFormat) > 0 if left(myFormat, 1) = " " then Ergebniss = Ergebniss & left(replace(myFormat, " ", " "), 6) else Ergebniss = Ergebniss & left(myFormat, 1) end if myFormat = right(myFormat, len(myFormat) - 1) loop end if case "m" y = 0 Do While left(myFormat, 1) = "m" myFormat = right(myFormat, len(myFormat) - 1) y = y + 1 Loop Select Case y Case 1 Ergebniss = Ergebniss & month(myDate) Case 2 if len(month(myDate)) = 1 then Ergebniss = Ergebniss & "0" end if Ergebniss = Ergebniss & month(myDate) Case 3 Ergebniss = Ergebniss & left(myMonthNames(month(myDate) - 1), 3) Case 4 Ergebniss = Ergebniss & myMonthNames(month(myDate) - 1) end select if len(myFormat) > 0 then do while left(myFormat, 1) <> "d" and left(myFormat, 1) <> "m" and left(myFormat, 1) <> "y" and left(myFormat, 1) <> "h" and left(myFormat, 1) <> "n" and left(myFormat, 1) <> "s" and len(myFormat) > 0 if left(myFormat, 1) = " " then Ergebniss = Ergebniss & left(replace(myFormat, " ", " "), 6) else Ergebniss = Ergebniss & left(myFormat, 1) end if myFormat = right(myFormat, len(myFormat) - 1) loop end if case "y" y = 0 Do While left(myFormat, 1) = "y" myFormat = right(myFormat, len(myFormat) - 1) y = y + 1 Loop Select Case y Case 2 Ergebniss = Ergebniss & right(year(myDate), 2) Case 4 Ergebniss = Ergebniss & year(myDate) end select if len(myFormat) > 0 then do while left(myFormat, 1) <> "d" and left(myFormat, 1) <> "m" and left(myFormat, 1) <> "y" and left(myFormat, 1) <> "h" and left(myFormat, 1) <> "n" and left(myFormat, 1) <> "s" and len(myFormat) > 0 if left(myFormat, 1) = " " then Ergebniss = Ergebniss & left(replace(myFormat, " ", " "), 6) else Ergebniss = Ergebniss & left(myFormat, 1) end if myFormat = right(myFormat, len(myFormat) - 1) loop end if case "h" y = 0 Do While left(myFormat, 1) = "h" myFormat = right(myFormat, len(myFormat) - 1) y = y + 1 Loop Select Case y Case 1 Ergebniss = Ergebniss & hour(myDate) Case 2 if len(hour(myDate)) = 1 then Ergebniss = Ergebniss & "0" end if Ergebniss = Ergebniss & hour(myDate) end select if len(myFormat) > 0 then do while left(myFormat, 1) <> "d" and left(myFormat, 1) <> "m" and left(myFormat, 1) <> "y" and left(myFormat, 1) <> "h" and left(myFormat, 1) <> "n" and left(myFormat, 1) <> "s" and len(myFormat) > 0 if left(myFormat, 1) = " " then Ergebniss = Ergebniss & left(replace(myFormat, " ", " "), 6) else Ergebniss = Ergebniss & left(myFormat, 1) end if myFormat = right(myFormat, len(myFormat) - 1) loop end if case "n" y = 0 Do While left(myFormat, 1) = "n" myFormat = right(myFormat, len(myFormat) - 1) y = y + 1 Loop Select Case y Case 1 Ergebniss = Ergebniss & minute(myDate) Case 2 if len(minute(myDate)) = 1 then Ergebniss = Ergebniss & "0" end if Ergebniss = Ergebniss & minute(myDate) end select if len(myFormat) > 0 then do while left(myFormat, 1) <> "d" and left(myFormat, 1) <> "m" and left(myFormat, 1) <> "y" and left(myFormat, 1) <> "h" and left(myFormat, 1) <> "n" and left(myFormat, 1) <> "s" and len(myFormat) > 0 if left(myFormat, 1) = " " then Ergebniss = Ergebniss & left(replace(myFormat, " ", " "), 6) else Ergebniss = Ergebniss & left(myFormat, 1) end if myFormat = right(myFormat, len(myFormat) - 1) loop end if case "s" y = 0 Do While left(myFormat, 1) = "s" myFormat = right(myFormat, len(myFormat) - 1) y = y + 1 Loop Select Case y Case 1 Ergebniss = Ergebniss & second(myDate) Case 2 if len(second(myDate)) = 1 then Ergebniss = Ergebniss & "0" end if Ergebniss = Ergebniss & second(myDate) end select if len(myFormat) > 0 then do while left(myFormat, 1) <> "d" and left(myFormat, 1) <> "m" and left(myFormat, 1) <> "y" and left(myFormat, 1) <> "h" and left(myFormat, 1) <> "n" and left(myFormat, 1) <> "s" and len(myFormat) > 0 if left(myFormat, 1) = " " then Ergebniss = Ergebniss & left(replace(myFormat, " ", " "), 6) else Ergebniss = Ergebniss & left(myFormat, 1) end if myFormat = right(myFormat, len(myFormat) - 1) loop end if case else if len(myFormat) > 0 then do while left(myFormat, 1) <> "d" and left(myFormat, 1) <> "m" and left(myFormat, 1) <> "y" and left(myFormat, 1) <> "h" and left(myFormat, 1) <> "n" and left(myFormat, 1) <> "s" and len(myFormat) > 0 if left(myFormat, 1) = " " then Ergebniss = Ergebniss & left(replace(myFormat, " ", " "), 6) else Ergebniss = Ergebniss & left(myFormat, 1) end if myFormat = right(myFormat, len(myFormat) - 1) loop end if end select loop else Ergebniss = Ergebniss & "Kein gültiges Datum!!!" end if getDateTime = Ergebniss End Function End Class ' Deklarieren der Variablen Dim EntityBody Dim Stream Dim OutDirectory Dim Dateiname Dim PartnerId Dim DocumentType Dim Datum ' Auslesen des aktuellen Timestamp Set Datum = New myDateTime 'Datum.myDayNames = Array("Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag") 'Datum.myMonthNames = Array("Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember") Datum.myDate = now Datum.myFormat = "yyyy-mm-dd_hhnnss" ' Auslesen der Uebergabeparameter(PartnerId, DocumentType und ) PartnerId = Request.QueryString("PartnerId") DocumentType = Request.QueryString("DocumentType") 'Hier wird das Verzeichnis angegeben, in das die Datei abgelegt werden soll. 'Auf dem Verzeichnis muss aber ASP Schreibrechte haben. OutDirectory = "C:\Test_Curl\From\" 'Hier wird der Zieldateiname angegeben, der Dateiname setzt sich immer 'aus dem DocumentType+Datum+Uhrzeit zusammen Dateiname = PartnerId&DocumentType&Datum.getDateTime()&".xml" 'Option Explicit Response.Buffer = True EntityBody = Request.BinaryRead (Request.TotalBytes) Set Stream = Server.CreateObject("AdoDB.Stream") Stream.Type = 1 stream.Open Stream.Write EntityBody Stream.Position = 0 Stream.SaveToFile OutDirectory & Dateiname Response.Status = "202 Accepted" Response.End %>
  3. leider funktionieren die beiden Funktionen nicht, ok Date funktioniert schon. Aber leider nicht wie ich das will. Mein Datum soll wie folgt aussehen "200501311700" Datum 31.01.2005 Zeit 17:00 Uhr
  4. Hallo Zusammen, ich habe gerade angefangen ASP zu programmieren und jetzt stehe ich vor einem Problem. Kann mir jemand sagen, wie ich hier beim Dateinname das wirkliche Datum und die wirklich Uhrzeit bekomme, also einen Timestamp? <% Option Explicit Response.Buffer = True Dim EntityBody Dim Stream Dim OutDirectory Dim Dateiname Dim PartnerId Dim DocumentType PartnerId = Request.QueryString("PartnerId") DocumentType = Request.QueryString("DocumentType") 'Hier wird das Verzeichnis angegeben, in das die Datei abgelegt werden soll. 'Auf dem Verzeichnis muss aber ASP Schreibrechte haben. OutDirectory = "C:\Test_Curl\From\" 'Hier wird der Zieldateiname angegeben 'Dateiname = "From.xml" Dateiname = DocumentType&"DatumZeit"&".xml" EntityBody = Request.BinaryRead (Request.TotalBytes) Set Stream = Server.CreateObject("AdoDB.Stream") Stream.Type = 1 stream.Open Stream.Write EntityBody Stream.Position = 0 Stream.SaveToFile OutDirectory & Dateiname Response.Status = "202 Accepted" Response.End %> Danke
  5. Hallo, weiß jemand von euch wie ich in ASP.NET eine voll editierbare DropDownList machen kann. Ich will auch den kompletten Wert aus der DropDownList per Hand eingeben und es wird dann automatisch vervollständigt. Danke
  6. Hallo, kann mit einer sagen, wie man folgenden VB Code als Webapplication umwandeln kann? Public Class AutocompleteComboBox Inherits ComboBox Private Sub AutocompleteComboBox_KeyUp(ByVal sender As Object, _ ByVal e As System.Windows.Forms.KeyEventArgs) _ Handles MyBase.KeyUp Dim typedText As String = Me.Text Dim index As Integer ' Behandlung der Pfeiltasten etc. zulassen Select Case e.KeyCode Case Keys.Left, Keys.Right, Keys.Up, Keys.Down, _ Keys.Delete, Keys.Back Return End Select ' Text in der Items-Liste suchen index = Me.FindString(typedText) ' Text vorhanden? If index >= 0 Then ' Ja, Item auswählen und hinzugefügten Teil markieren Me.SelectedIndex = index Me.Select(typedText.Length, Me.Text.Length) End If End Sub End Class
  7. Hallo, ich habe eine ASP Datei in der ein Formular ist, jetzt will ich Javascript einbinden aber ich weis leider nicht wie. Kann man innerhalb einem ASP Formular auch nur ganz normale HTML Befehle ohne konsequenzen verwenden, denn das kann ich Jacascript einbinden. Bin neu, arbeite erst seit 3 Tagen mit ASP in meiner Firma. Danke
  8. Hallo, ich habe ein Formular mit drei Textfelder in zwei Textfelder gibt man einen Wert ein. Diese Werte sollen dann berechnet werden und im 3 Textfeld ausgegeben werden. Das ganze soll aber erfolgen bei der Werteeingabe und nicht erst wenn man auf einen Button drückt. Danke
  9. ich darf in dieser Zeile keinen Typ angeben. <asp:Button id="cmdSetFilter" tabIndex="5" runat="server" Text="Starte Suche"></asp:Button>
  10. Ich habe eine Such-Formular und wenn ich jetzt Enter betätige soll er suchen. Den bei mir geht er nicht automatisch auf suchen wenn man Enter betätigt, keine Ahnung wieso nicht.
  11. tut mir Leid aber irgend wie finde ich da trotzdem keinen Lösung wie ich einem Button Enter zuweisen kann. Kannst du vielleicht bisschen genauer werden? Danke
  12. Hallo, gibt es einen AccessKey für Enter um einen speziellen Button mit Enter in einem Formular anzuwählen? Danke
  13. Hallo, ich habe nächsten Dienstag die Präsentation für die Facharbeit und jetzt würden mich die Bewertungskriterien für die Präsentation interessieren. Hat vielleicht von euch einer so einen Bewertungsbogen? Danke
  14. Hallo, wie kann ich einen Emailadresse prüfen ob sie in korrekter Form vorliegt, @ - Zeichen .Donmain usw.? Ich habe gehört das es dafür einen algoryhtmus gibt. Danke
  15. Hallo, ich habe eine kurze Frage zum Email versenden in PHP. gibt es eine Möglichkeit die versendete Mail zu formatieren, weil ich nicht alles in einer Zeile stehen haben will?
  16. hallo, gibt es bei mysql so etwas wie den autowert bei access? danke
  17. hallo, eine kurze frage. wie kann ich in jsp unterdrücken das man in der url die parameter mit den werten sieht? danke
  18. javaanfänger

    Profi ?

    schaut euch mal den a...h an http://www.*****.**/ der und profi, der versaut den ruf von wirklichen profis
  19. Download J2SE v 1.4.2_02 das kommt weiterunten

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...