Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

HttpRequest

Empfohlene Antworten

Veröffentlicht

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



%>

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.