FindControl ricorsivo

by 28. ottobre 2009 15.54
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

Tags: , ,

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

by 23. ottobre 2009 14.35

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.

 

Tags: ,

Windows Mobile: path di esecuzione dell'applicazione

by 13. ottobre 2009 11.53

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

Tags:

Windows Mobile: rilevare la versione

by 13. ottobre 2009 11.34

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

Tags: ,

Page List

Calendar

<<  febbraio 2012  >>
lumamegivesado
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar