vbdotnet.it

Tricks & tips, workaround, forum and ideas with .Net

About the author

Enrico Rossini è il gestore di questo blog.
E-mail me Send mail

Recent posts

Recent comments

Contributi

Best 6 ~ 6 users ~ 6 comments

Info legali

Le opinioni espresse in questo blog sono strettamente personali e ogni persona è responsabile dei commenti che inserisce. I marchi citati sono delle rispettive aziende.

© Copyright 2010

Advertising


FindControl ricorsivo

Imports System.Collections.Generic
 
Private Shared Function FindControlIterative(ByVal root As Control, _
        ByVal id As String) As Control
 
        Dim ctl As Control = root
        Dim ctls As LinkedList(Of Control) = New LinkedList(Of Control)
 
        Do While (ctl IsNot Nothing)
            If ctl.ID = id Then
                Return ctl
            End If
            For Each child As Control In ctl.Controls
                If child.ID = id Then
                    Return child
                End If
                If child.HasControls() Then
                    ctls.AddLast(child)
                End If
            Next
            ctl = ctls.First.Value
            ctls.Remove(ctl)
        Loop
 
        Return Nothing
 
End Function

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by enrico on Wednesday, October 28, 2009 4:54 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Conversione progetto da .NET 1.x: errore allowDefinition = 'MachineToApplication'

Nel convertire un progetto .NET 1.x alla versione 2.0 o superiore, ci si imbatte quasi sempre in questo criptico errore. "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level This error can be caused by a virtual directory not being configured as an application in IIS."  Il problema è che la conversione crea una cartella Backup con all'interno un file web.config che va in conflitto con quello presente nella cartella principale.

Cancellando la cartella Backup il problema viene risolto.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by enrico on Friday, October 23, 2009 3:35 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Windows Mobile: path di esecuzione dell'applicazione

Come trovare il path dell'applicazione corrente su Windows Mobile?

Public Function AppPATH() As String
   Return Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetModules(0).FullyQualifiedName)
End Function

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by enrico on Tuesday, October 13, 2009 12:53 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Windows Mobile: rilevare la versione

Come riuscire a rilevare la versione del sistema operativo installato sul proprio palmare?

If System.Environment.OSVersion.Version.Major < 5 Then

MessageBox.Show("Versione 2003")

Else

MessageBox.Show("Versione 5.0")

End If

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by enrico on Tuesday, October 13, 2009 12:34 PM
Permalink | Comments (0) | Post RSSRSS comment feed