Visualizzazione dei risultati da 1 a 5 su 5

Discussione: da vb.net to c#

  1. #1

    da vb.net to c#

    ciao,
    dato che vado di fretta non mi va di tradurmi questo:
    codice:
    Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
        Dim stringWriter As System.IO.StringWriter = New System.IO.StringWriter
        Dim htmlWriter As HtmlTextWriter = New HtmlTextWriter(stringWriter)
        MyBase.Render(htmlWriter)
        Dim html As String = stringWriter.ToString()
        Dim StartPoint As Integer = html.IndexOf("<input type=""hidden"" name=""__VIEWSTATE""")
        If StartPoint >= 0 Then
          Dim EndPoint As Integer = html.IndexOf("/>", StartPoint) + 2
          Dim ViewStateInput As String = html.Substring(StartPoint, EndPoint - StartPoint)
          html = html.Remove(StartPoint, EndPoint - StartPoint)
          Dim FormEndStart As Integer = html.IndexOf("</form>") - 1
          If FormEndStart >= 0 Then
            html = html.Insert(FormEndStart, ViewStateInput)
          End If
        End If
        writer.Write(html)
      End Sub

    qualcuno di voi ha il tool per tradurlo?

  2. #2
    me lo sono fatto da solo

    codice:
    protected override void Render (System.Web.UI.HtmlTextWriter writer)
    		{
    			System.IO.StringWriter stringWriter = new System.IO.StringWriter();
    			System.Web.UI.HtmlTextWriter htmlWriter = new System.Web.UI.HtmlTextWriter(stringWriter);
    			base.Render(htmlWriter);
    			string html = stringWriter.ToString();
    			int StartPoint = html.IndexOf("<input type=\"hidden\" name=\"__VIEWSTATE\"");
    			if (StartPoint >= 0)
    			{
    				int EndPoint = html.IndexOf("/>", StartPoint) + 2;
    				string ViewStateInput = html.Substring(StartPoint, EndPoint - StartPoint);
    				html = html.Remove(StartPoint, EndPoint - StartPoint);
    				int FormEndStart = html.IndexOf("</form>") - 1;
    				if (FormEndStart >= 0)
    				{
    					html = html.Insert(FormEndStart, ViewStateInput);
    				}
    			}
    			writer.Write(html);
    		}

  3. #3
    Utente di HTML.it L'avatar di pietro09
    Registrato dal
    Jan 2002
    Messaggi
    10,116
    Come mi rispose un giorno Daniele80, chi fa da sč, fa per tre e fa prima dico io
    Pietro

  4. #4
    č gia...hai proprio ragione.


    sono super impegnato e non so a chi dare il resto. Questa cosa pensa che mi serve per i motori di ricerca.

  5. #5

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.