בעיה חמורה (VS7)

Admini

New member
BASE64; Quoted-Printable

אני מחפש decoder לקידוד BASE64 ו-decoder לפורמט Quoted-Printable. חיפשתי ב-MSDN ובגוגל ולא כ"כ מצאתי. יש לי קוד ישן ל-Quoted-Printablw שעובד יפה אבל הוא מבוסס על אובייקט COM כלשהו ואני לא כ"כ אוהב את זה.. יש רעיון ?
 

gilad g

New member
המממ

אתה יכול בכל זאת להשתמש באובייקט COM... שימוש פשוט ב-COM Interop
 

Admini

New member
אז חיפשתי

ומתברר ששום פונקצית קידוד שניסיתי לא מסוגלת לקודד נושא של דוא"ל נכנס הנושא נראה ככה: =?windows-1255?B?8un65e8g7vn45fogODY=?= שזה אומר (אחרי שקראתי 500 מסמכי RFC): ?= - התחלת קידוד בשפה שאינה אנגלית windows-1255 - הקידוד ?B? - שזה Q או B - BASE64 או Quoted-Printable ואז הקוד המקודד וסיומת =?=
 

Admini

New member
על זה התבססתי

Function DecodeSubject(ByVal Subject As String) If inStr(1,Subject,"?B?") >0 ' אם זו כותרת בפורמט BASE64 Dim iStart iStart = inStr(1,Subject,"?B?")+3 ' בדיקה מתי מתחיל הטקסט עצמו return cStr(DecodeB64Subject(Replace(Subject,"=?=",""),iStart,Len(Subject))) 'שליחה של המחרוזת לשחזור Else Return Subject ' אם זו כותרת רגילה - שחזר אותה End If End Function Function DecodeB64Subject(ByVal Subject As String) Response.Write(Subject) : Response.Flush() Dim b = Convert.FromBase64String(Subject) Return b.ToString() End Function​
ניסיתי גם עוד קוד (קוד של ASP3.0 עם שינויים קלים) והוא החזיר אותה שגיאה
 

gilad g

New member
זה בגלל

שאתה לא יכול ככה סתם להפוך מערך של בתים לסטרינג, אתה צריך להשתמש בקידוד מסוים. בכל אופן, ככה אני הייתי עושה את זה:
byte[] input; byte[] output; FromBase64Transform from_transform = new FromBase64Transform(); System.Text.Encoding hebrew = System.Text.Encoding.GetEncoding( "windows-1255" //change this to the encoding used in the email message ); input = hebrew.GetBytes(textBox1.Text); output = from_transform.TransformFinalBlock(input, 0, input.Length); textBox2.Text = hebrew.GetString(output);​
 

Admini

New member
עוד בעיה (סוקט)

יש לי סוקט (או אובייקט שמכיל סוקט). כאשר אני מעביר אותו למשתנה Session ומחזיר אותו משם (בעזרת CTYPE) האובייקט עובר תקין אבל החיבור מתנתק ולא ניתן לעבוד איתו יותר. יש רעיון למה ?
 

yuval k

New member
ההשערה שלי:

אתה לא יכול לשמור socket, שעובד (כמובן) כשהוא מחובר - אפילו כ-session - בדף אינטרנט, שעובד ב-model disconnected... אם כי אני לא בטוח
ההגיוני הוא לחבר אותו מחדש, או לשמור את ה-Endpoint שלו וליצור Socket חדש לפיו.
 

Admini

New member
חשוב לציין

שניסיתי ב-2 מקרים: גם כשזה היה ישירות על ASP וגם במקרה שזה היה דרך רכיב... חשוב לציין שה-FW מראה ש-ASPNET_WP משאיר את החיבור פתוח
 

Admini

New member
בעיה מוזרה

Server Error in '/lmm' Application. -------------------------------------------------------------------------------- Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30466: Namespace or type 'y' for the Imports 'y' cannot be found. Source Error: Line 27: Imports System.Web.UI.HtmlControls Line 28: Imports System.Web.UI.WebControls Line 29: Imports y Line 30: Line 31: Namespace ASP Source File: C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\lmm\0b3ccb36\b454e10\yfybsbo4.0.vb Line: 29​
מעולם לא כתבתי את הקוד הזה... זה נוצר אוטומטית, תכולת הקובץ היא:
'------------------------------------------------------------------------------ ' <autogenerated> ' This code was generated by a tool. ' Runtime Version: 1.1.4322.573 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </autogenerated> '------------------------------------------------------------------------------ Option Strict Off Option Explicit On Imports ASP Imports Microsoft.VisualBasic Imports System Imports System.Collections Imports System.Collections.Specialized Imports System.Configuration Imports System.Text Imports System.Text.RegularExpressions Imports System.Web Imports System.Web.Caching Imports System.Web.Security Imports System.Web.SessionState Imports System.Web.UI Imports System.Web.UI.HtmlControls Imports System.Web.UI.WebControls Imports y Namespace ASP <System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()> _ Public Class lmm_inbox_aspx Inherits lmm.lmm_inbox Implements System.Web.SessionState.IRequiresSessionState Private Shared __autoHandlers As Integer Private Shared __initialized As Boolean = false Private Shared __fileDependencies As System.Collections.ArrayList #ExternalSource("D:\inetpub\wwwroot\ezra\lmm\lmm_inbox.aspx",3) #End ExternalSource Public Sub New() MyBase.New Dim dependencies As System.Collections.ArrayList If (ASP.lmm_inbox_aspx.__initialized = false) Then dependencies = New System.Collections.ArrayList dependencies.Add("D:\inetpub\wwwroot\ezra\lmm\lmm_inbox.aspx") ASP.lmm_inbox_aspx.__fileDependencies = dependencies ASP.lmm_inbox_aspx.__initialized = true End If Me.Server.ScriptTimeout = 30000000 End Sub Protected Overrides Property AutoHandlers As Integer Get Return ASP.lmm_inbox_aspx.__autoHandlers End Get Set ASP.lmm_inbox_aspx.__autoHandlers = value End Set End Property Protected ReadOnly Property ApplicationInstance As ASP.Global_asax Get Return CType(Me.Context.ApplicationInstance,ASP.Global_asax) End Get End Property Public Overrides ReadOnly Property TemplateSourceDirectory As String Get Return "/lmm" End Get End Property Private Sub __BuildControlTree(ByVal __ctrl As System.Web.UI.Control) __ctrl.SetRenderMethodDelegate(AddressOf Me.__Render__control1) End Sub Private Sub __Render__control1(ByVal __output As System.Web.UI.HtmlTextWriter, ByVal parameterContainer As System.Web.UI.Control) __output.Write(""&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)&"<html>"&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)&"<head>"&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)&"</head>"&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)&"<body>"&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)&"<table width=100%>"&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)&" ") #ExternalSource("D:\inetpub\wwwroot\ezra\lmm\lmm_inbox.aspx",​
 

Admini

New member
המשך

יצרתי פרוייקט חדש ב-VS והעתקתי אליו פונקציות שהיו בתוך עמוד ב-Script runat=server. השגיאה הזו הופיעה מאיפשהו ואין לי מושג איך לתקן אותה (זה קובץ זמני ושינוי שלו לא בא בחשבון).
 

Admini

New member
בעיה חמורה (VS7)

VS לא מזהה פקד ASCX שלי שעובד יפה:
<%@ Register TagPrefix="lmm" TagName="title" Src="lmm_title.ascx" %>​
ואיפשהו באמצע:
<lmm:title runat="server" ID="Title">​
הוא לא מזהה את האובייקט ולא נותן לי לעבוד (מחזיר שגיאה על כל נסיון קריאה אליו) כאשר אין נסיונות קריאה לאובייקט ה-HTML שלו מוצג כהלכה. יש רעיון ?
 
למעלה