Alex's Weblog

Weblog di Ermanno Goletto (Codename Alex - A Learning EXperience)
posts - 438, comments - 4214, trackbacks - 294

My Links

News

Il blog è stato
trasferito al
 seguente link:


DevAdmin Blog

Add my blog to Live

Foto

Curriculum Vitae


Il contenuto di questo blog e di ciascun post viene fornito “così come é”, senza garanzie, e non conferisce alcun diritto. Questo blog riporta il mio personale pensiero che non riflette necessariamente il pensiero del mio datore di lavoro.

Logo Creative Commons Deed


Logo MCTS

Logo MCSA

Logo MCP

Logo Microsoft Certified Business Management Solutions Professional

Microsoft Certified Business Management Solutions Specialist


Logo UGIdotNET UGIdotNET Contributor


Logo UGISS UGISS Contributor


Logo SysAdmin.it SysAdmin.it Staff


Article Categories

Archives

Post Categories

Blogs

Database

Development

Friends

IT

Knowledge Base

Links

MBS

MCP

MVP Sites

User Groups

Virtualization

.NET Framework

Ricavare i path di default per i file di dati e logs in SQL Server 2005

Una delle impostazioni che possibile fare su un'istanza di SQL Server è quella del percorso di default in cui memorizzare file dati e logs di un nuovo database. Ho fatto diverse ricerca, ma non trovato un modo semplice per ricavare tramite T-SQL tali informazioni. A quanto sembra se si modificano tali percorsi questi vengono memorizzati nelle chiavi di registry: HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\MSSQLServer\DefaultData HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\MSSQLServer\DefaultLog In caso contrario i path è quello specificato durante l'installazione per i File di dati quindi si può pensare di ricavarli dai path dei file mdf e ldf del database master. Di seguito uno...

posted @ giovedì 29 maggio 2008 22:50 | Feedback (29) | Filed Under [ Code & Snippet Database .NET Framework .NET Framework 2.0 ]

Autosizing delle righe di un DataGrid

A volte mi capita di dover mettere mano a codice .NET 1.1 su Visual Studio 2003 e in questa versione la griglia nativa il DataGrid non era ricco di funzionalità. L'ultima richiesta che mi è arrivata è come realizzare l'autosizing delle righe per vedere completamente il contenuto delle righe le cui colonne vano su più righe. Manualment la cosa è possibiole quindi la funzionalità in effetti c'è ma non è esposta e quindi occorre utilizzare la reflection come indicato in questo link http://www.syncfusion.com/FAQ/winforms/FAQ_c44c.aspx Di seguito la versione che ho realizzato: Private Sub AutoSizeRows(ByVal columnStyle As System.Windows.Forms.DataGridColumnStyle)   Dim dataGrid As System.Windows.Forms.DataGrid = columnStyle.DataGridTableStyle.DataGrid  ...

posted @ venerdì 16 maggio 2008 16:59 | Feedback (19) | Filed Under [ Links Code & Snippet .NET Framework ]

Inviare mail tramite .NET 1.1 con Exchange 2003 e Exchange 2007

In questo articolo ho raccolto alcune riflessioni su come inviare mail tramite .NET Framework 1.1 e 2.0 utilizzando Exchange 2003 e Exchange 2007 analizzando le differenze relative alla gestione dell'autenticazione in .NET 1.1 e 2.0 e le modifiche apportate in Exchange 2007 rispetto a Exchange 2003.

posted @ mercoledì 9 aprile 2008 13:15 | Feedback (14) | Filed Under [ Code & Snippet Tips IT .NET Framework .NET Framework 2.0 ]

Sincronizzazione Replica SQL Server 2005 per sottoscrizioni Pull

Dopo aver configurato la replica il passo successivo è quello di automatizzare la sincronizzazione delle sottoscrizioni e per farlo vi sono vari modi come ad esempio utilizzare Windows Synchronization Manager (mobsync.exe) che permette l'impostazione della sincronizzazione all'accesso, alla chiusura, durante l'inattività o in modo pianificato. Se però come, nel mio caso, per eseguire la sincronizzazione è necessario avviare prima una connesione VPN e chiuderla al termine la cosa si complica perchè mobsync consente di gestire la connesione automatica sono per sincronizzazioni pianificate. Per ovviare è possibile ricorrere ad uno script di questo tipo: SET ConnectionName="Nome Connessione RAS" SET Publisher=NomeServerPubblicazione SET Subscriber=NomeServerSottoscrizione SET PublicationDB=NomeDBPubblicazione SET SubscriptionDB=NomeDBSottoscrizione SET Publication=NomePubblicazione Rem Avvio connessione...

posted @ giovedì 27 marzo 2008 22:31 | Feedback (8) | Filed Under [ Links Tips Database IT .NET Framework .NET Framework 2.0 ]

L'ordine di installazione

Mi era già capitato di vedere altre volte sul alcuni computer che all'apertura della Management Studio 2005 venisse visualizzata una dialog vuota, ebbene oggi mi è capitato su un computer XP SP2 appena installato su cui era stato installato il .NET Framework 2.0, l'installer 3.1, SQL Server 2005 Express with Advanced Services e al termine l'aggiornamento con Microsoft Update per installare hotfix (una novantina) e IE 7. Sul pc così configurato su cui la Management Studio 2005 non dava nessun problema è stato installato il .NET Framework 1.1 e da lì è comparsa la misteriosa dialog che non scompariva neppure...

posted @ venerdì 7 marzo 2008 00:18 | Feedback (6) | Filed Under [ Links Tips Database IT .NET Framework .NET Framework 2.0 ]

Controllare le statistiche di rete

Siccome ho dovuto mettere mano ad una rete non realizzata da me in cui di verificavano rallentamenti e problemi vari mi sono scritto un'utility basata su .NET 1.1 che eseguisse i vari comandi per controllare le impostazioni e le statistiche dire e ne catturasse l'output oltre a recuperare le statistiche IP, TCP e UDP via API. Per comodità le informazioni sono inserite in un RichTextBox ed è possibile eseguire una semplice stampa. La versione 1.0.0.0 di tle utility la trovare al seguente link (utilizzate tasto dx salva oggetto con nome): http://xoomer.alice.it/ermannogoletto/MyLab/CheckNet2003v1.0.0.0.zip

posted @ martedì 15 gennaio 2008 13:22 | Feedback (8) | Filed Under [ Links IT .NET Framework ]

Stampare un'immagine con .NET

Nel caso sia necessario stampare un'immagine rispettando le dimensioni della stessa e posizionandola in modo preciso sulla pagina il .NET Framework offre nativamente tutto ciò che ci serve. Occorre però fare alcune considerazioni sulle unità di misura che mi annoto a mia futura memoria e per eventaule utilità di altri:  Per comodità si esprimeranno le misure dei margini che utilizzerò per posizionare l'immagine e le dimensioni della stessa in millimetri. L'unità di misura dei margini nell'oggetto DefaultPageSettings sono espresse in centesimi di pollice. Oltre ai magini si deve tenere conto anche...

posted @ giovedì 8 novembre 2007 20:02 | Feedback (9) | Filed Under [ Links Tips .NET Framework .NET Framework 2.0 ]

String.Format e i valori Boolean

Leggendo questo post di Corrado mi è venuto in mente un modo per formattare i valori booleani partendo dal fatto che CInt(True ) è -1 e CInt(False) è 0: String.Format("Il valore è {0:Falso;Vero}.",CInt(booleanValue))

posted @ lunedì 20 agosto 2007 02:44 | Feedback (12) | Filed Under [ Code & Snippet .NET Framework .NET Framework 2.0 ]

Preview di uno Screensaver in un oggetto container

Per fare il preview di uno Screensaver in un oggetto container è possibile utilizzare il parametro /p dello stesso. Di seguito il codice per visualizzare uno Screensaver in una PictureBox: Private Const ScreenSaverName As String = "ssbezier.scr"Private screenSaverProcess As System.Diagnostics.Process Dim startInfo As New System.Diagnostics.ProcessStartInfostartInfo.Arguments = "/p " & Me.PictureBox1.Handle.ToString()startInfo.FileName = ScreenSaverNamestartInfo.UseShellExecute = FalsescreenSaverProcess = System.Diagnostics.Process.Start(startInfo) Per arrestare la visualizzazione dello Screensaver basterà terminare il processo:screenSaverProcess.Kill()screenSaverProcess.Close()screenSaverProcess.Dispose()

posted @ mercoledì 8 agosto 2007 22:18 | Feedback (3) | Filed Under [ Code & Snippet .NET Framework .NET Framework 2.0 ]

www.easydotnet.it ovvero il sito per chi vuole inziare a lavorare con .NET

Voglio segnalare, anche se con estremo ritardo, questo spendido sito nato dalla collaborazione di un cuneese (Ugo Silato) e di un napoletano (Marco Siniscalco) che si propone di supportare chi vuole iniziare a lavorare con .NET. Quindi per quanti hanno in mente qualche articolo base sulla tecnologia .NET, ma non sapendo dove pubblicarlo hanno messo nel casetto l'iniziativa adesso non ci sono più scuse per nessuno (me compreso).

posted @ martedì 29 maggio 2007 00:09 | Feedback (3) | Filed Under [ Links .NET Framework ]

Ricavare la porta di una stampante

Per ricavare la porta di una stampante in VS 2003 è possibile utilizzare WMI e in particolare la classe Win32_Printer : Public Shared Function GetPrinterPortName(ByVal printerName As String) As String     Dim portName As String = String.Empty     Dim path As String = String.Format("Win32_Printer.DeviceID='{0}'", printerName)     Dim p As New System.Management.ManagementObject(path)      p.Get()     portName = p("PortName").ToString()     p.Dispose() : p = Nothing     Return portNameEnd Function Per utilizzare il codice occcore aggiungere un reference a System.Management. In VS 2005 non ho trovato funzionalità native per ricavare la porta della stampante anche se inizialmente era previsto un My.Computer.Printers come si può leggere nel seguente articolo http://msdn.microsoft.com/msdnmag/issues/04/05/VisualBasic2005/ ma nella versione definitiva pare non sia poi stato implementato chissà se conteneva...

posted @ mercoledì 21 febbraio 2007 17:44 | Feedback (8) | Filed Under [ Links Code & Snippet .NET Framework .NET Framework 2.0 ]

Comportamento anomalo su chiusura form in VS 2003

Nel caso in cui si abbia un pulsante che chuiude la form e e quando lo si seziona una validate di un controllo fallisce la form non verrà chiusa anche nel caso in cui sul pulsante si sia impostato CausesValidation = False. Io ho risolto inserendo nel click del pulsante il seguente codice:         For Each cnt As System.Windows.Forms.Control In Me.Controls            cnt.CausesValidation = False        Next        Me.CausesValidation = False         Me.Close() Lo stesso comportamento lo si riscontra anche se si tenta di chiudere la form con il pulsante di chiusura di sustema (X rossa), a tal proposito si veda il seguente:A control's Validating event is...

posted @ martedì 13 febbraio 2007 18:52 | Feedback (8) | Filed Under [ Links Code & Snippet .NET Framework ]

WSUS e SID duplicati

Nel caso in cui nella rete si abbiano computer con SID identici, dovuto al fatto che l'installazione è stata fatta partendo da un'identica immagine tramite tool tipo Ghost qunado si installa WSUS si riscontreranno malfunzionamenti dovuti al fatto che le patch verranno distribuite solo ad una macchina in quanto WSU non sarà in grado di distinguerle. A tal proposito si legga il seguente Attack of the Clones. Se ci si trova in questa situazione occorrerà cabiare il SID alle macchine con strumenti quali Sysprep o Newsid e quindi eliminare i SID duplicati in WSUS e a questo proposito si veda Delete Duplicate SUS...

posted @ giovedì 1 febbraio 2007 13:59 | Feedback (45) | Filed Under [ Links Code & Snippet IT .NET Framework ]

Gestione dell'ora legale

Se nelle operazioni fra date è necessario tenere conto dell'ora legale è possibile utilizzare il metodo ToLocalTime: Si veda il seguente codice: Dim date1 As DateTime = #10/29/2006 2:00:00 AM# Console.WriteLine(date1.AddHours(2))Console.WriteLine(date1.AddHours(2).ToLocalTime) Output:29/10/2006 4.00.0029/10/2006 5.00.00 Per sapere se una data cade nel periodo dell'ora legale è possibile utilizzare il metodo System.TimeZone.CurrentTimeZone.IsDaylightSavingTime Si veda il seguente codice: Dim date1 As Date = #10/28/2006 2:00:00 AM#Dim date2 As Date = #10/29/2006 4:00:00 AM# Console.WriteLine(System.TimeZone.CurrentTimeZone.DaylightName)Console.WriteLine(System.TimeZone.CurrentTimeZone.GetDaylightChanges(2006).Start)Console.WriteLine(System.TimeZone.CurrentTimeZone.GetDaylightChanges(2006).End) Console.WriteLine(System.TimeZone.CurrentTimeZone.IsDaylightSavingTime(date1))Console.WriteLine(System.TimeZone.CurrentTimeZone.IsDaylightSavingTime(date2)) Output:ora solare Europa occidentale26/03/2006 2.00.0029/10/2006 3.00.00TrueFalse

posted @ venerdì 12 gennaio 2007 13:16 | Feedback (4) | Filed Under [ Code & Snippet .NET Framework .NET Framework 2.0 ]

Data Adapter Configuration Error durante la creazione di Dataset tipizzati

Se in VS 2003 si crea una connessione ad un SQL Server 2005 utilizzando come provider Microsoft OLE DB Provider for SQL Server e tramite essa si cerca di creare un Dataset tipizzato trascinando una tabella si verifica il seguente errore: Data Adapter Configuration Error the wizard detected the following problems when configuring the data adapter for "TableName" Details:Error in SELECT clause: expression near '['.Error in FROM clause: near '['Unable to parse query text. Per evitare l'errore occorre utilizzare il provider SQL Native Client.

posted @ martedì 9 gennaio 2007 19:12 | Feedback (3) | Filed Under [ Tips Database .NET Framework ]

Sostituzione del dataset utilizzato da un report basato su Crystal Reports

Per sostiture il dataset utilizzato da un report è possibile utilizzare la funzionalità Set Location del riquadro Field Explorer che consente di modificare la Current Data Source con quella specificata. Nel caso in cui lo schema del nuovo DatSet differisca da quello di partenza sarà necessario indicare con quale DataTable sostituire ciascuna DataTable originale. Se anche le DataColumn tra le tabelle non sono corrispondenti comparirà la dialog Map Fields che conentirà di riassegnare le DataColumn della nuova DataTable ai fileds del report. A questo punto il report userà il nuovo DataSet anche se i nomi delle DataTable visualizzate il Field Explorer rimarranno quelle...

posted @ venerdì 5 gennaio 2007 18:27 | Feedback (2) | Filed Under [ Links Tips .NET Framework .NET Framework 2.0 ]

Eseguire applicazioni ASP.NET su un Domain Controller

Non è una pratica certamente consigliata il DC dovrebbe essere un computer dedicato esclusivamente a questo scopo.Se però vi trovate un cliente con SmallBusiness e senza intenzione di avere un computer dedicato potere trovarvi in questa situazione e in questo caso l'utente localmachinename\ASPNET con cui viene eseguito il processo Aspnet_wp.exe non viene trovato in quanto utente locale mentre un DC ha solo utenti di dominio. Come spiegato nel seguente articolo http://support.microsoft.com/kb/315158 in questo caso occorre creare un utente di dominio ad hoc e configurarlo nel machine.config.

posted @ giovedì 28 settembre 2006 17:20 | Feedback (1) | Filed Under [ Links Tips Security IT .NET Framework .NET Framework 2.0 ASP ]

Il metodo PrintToPrinter di Crystal Report VS 2003 e salti pagina non desiderati

In questo periodo ho creato un'applicazione per un magazzino che si occupava di stampare un etichetta per ogni pesatura effetuata da un operatore.Quindi ho creato un report con intestazione e dettaglio disabilitando le altre sezioni e utilizzando un DataSet come fonte dati, il tutto in ambiente VS 2003.Siccome sul pc era presente solo la stampante per le etichette mi è venuto naturale aggiungere alla form il report e usare il metodo PrintToPrinter per stamparlo.Il problema era che venivano eseguiti salti pagina non impostati dopo la stampa dell'etichetta.Per risolvere il problema ho usato il seguente codice:        Me.rptEtichetta.Close()        Me.rptEtichetta.SetDataSource(Nothing)        Me.rptEtichetta.SetDataSource(Me.dstEtichetta)        Me.rptEtichetta.PrintToPrinter(1, False,...

posted @ domenica 17 settembre 2006 15:48 | Feedback (3) | Filed Under [ Code & Snippet .NET Framework ]

ASP.NET 2.0 & Visual Studio .NET

How to embed resources in ASP.NET 2.0 assemblies http://support.microsoft.com/kb/910445 How to use application resource files (.resx) to efficiently create a localizable ASP.NET Web application http://support.microsoft.com/kb/917414 How to switch the IDE language in Visual Studio .NET 2002, Visual Studio .NET 2003, or Visual Studio 2005 http://support.microsoft.com/kb/919487

posted @ giovedì 13 luglio 2006 16:19 | Feedback (1) | Filed Under [ Links .NET Framework .NET Framework 2.0 ASP ]

Un altro motivo per valutare l'uso di P/Invoke

Ieri ho partecipato al seminario riservato ai partner Certifica la tua ApplicazioneCertifica la tua Applicazione in cui sono state illustrate le richieste per superate il Microsoft Platform Test for ISV Solutions (se vi interessano i dettagli vi rimando al seguente link Veritest: certificazione delle vostre applicazioni ) In sostanza per la competenza ISV/Software Solutions, è necessario che un'applicazione software superi due componenti del Platform Test, tra cui almeno un componente fondamentale. Tra i componenti opzionali troviamo Managed Code che per essere soddisfatto richiede il seguente requisito (cito testualmente):Tutti gli assembly delle applicazioni (EXE, DLL e così via) sono costituiti da codice gestito basato su...

posted @ mercoledì 21 giugno 2006 12:52 | Feedback (5) | Filed Under [ Links Design .NET Framework .NET Framework 2.0 ]

Ricavare l'icona associata ad un file

Con il .NET Framework 1.0 e 1.1 un modo era ricorrere all'api SHGetFileInfo come descritto nel seguente:http://support.microsoft.com/kb/319340/en-us Con l'introduzione del metodo ExtractAssociatedIcon del .Net framework 2.0 è possibile ottenere lo stesso risultato tramite l'utilizzo del registry evitando così l'utilizzo di PInvoke:     Public Shared Function GetFileExtensionIcon(ByVal fileExtension As String) As System.Drawing.Icon        Dim defaultIconFile As String = Nothing         Dim keyExtension As Microsoft.Win32.RegistryKey         keyExtension = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey("." & fileExtension)         If keyExtension IsNot Nothing Then            'Lettura program name            Dim programName As String            programName = keyExtension.GetValue(String.Empty).ToString             'Lettura program default icon            Dim keyProgramDefaultIcon As Microsoft.Win32.RegistryKey            keyProgramDefaultIcon = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey( _                programName & "\DefaultIcon")             If keyProgramDefaultIcon IsNot Nothing Then                Dim...

posted @ mercoledì 14 giugno 2006 13:28 | Feedback (1) | Filed Under [ Links Code & Snippet .NET Framework .NET Framework 2.0 ]

Dispose di componenti in form

Oggi avevo bisogno di usare in una form una DataTable e volevo che alla dispose della form venisse fatta anche la dispose della DataTable e tra me ho pensato potrei usare un DataSet che posso aggiungere come un componente e che verrà quindi aggiunto alla collezione components e alla Dispose della form verrà rilasciato visto che il codice generato per la dispose della form è il seguente:         'Form overrides dispose to clean up the component list.        Protected Overrides Sub Dispose(ByVal disposing As Boolean)            If disposing AndAlso components IsNot Nothing Then                components.Dispose()            End If            MyBase.Dispose(disposing)        End Sub Peccato che la quando viene...

posted @ venerdì 9 giugno 2006 12:38 | Feedback (2) | Filed Under [ Code & Snippet .NET Framework .NET Framework 2.0 ]

Distinguere come è avvenuta la chiusura di un form

Il post è stato trasformato in Tip ed è disponibile al seguente link:http://www2.ugidotnet.org/tips/tips_read.aspx?ID=173

posted @ giovedì 27 aprile 2006 16:53 | Feedback (19) | Filed Under [ Code & Snippet .NET Framework .NET Framework 2.0 ]

KB .NET & IIS

How to install and update the .NET Framework 1.1 on different operating systemshttp://support.microsoft.com/kb/915756 IIS and client certificateshttp://support.microsoft.com/kb/907274

posted @ giovedì 27 aprile 2006 10:09 | Feedback (83) | Filed Under [ Links Security IT .NET Framework ]

Utilizzo EnvDTE e errori "Applicazione occupata" e "Chiamata respinta dal chiamato"

Il seguente link http://msdn2.microsoft.com/it-it/library/ms228772.aspx suggerisce una soluzione per il seguente problema: Se si esegue una chiamata a livello di codice all'automazione di Visual Studio da un'applicazione multithread esterna (out-of-process), è possibile che talvolta si verifichino gli errori di "Applicazione occupata" o "Chiamata respinta dal chiamato". Si tratta di errori dovuti a problemi di conflitto di threading tra applicazioni multithread esterne e Visual Studio. Tali problemi possono essere eliminati con l'implementazione di gestori di errori IOleMessageFilter nell'applicazione di automazione di Visual Studio (da non confondersi con System.Windows.Forms.IMessageFilter).

posted @ venerdì 14 aprile 2006 19:17 | Feedback (1) | Filed Under [ Links .NET Framework .NET Framework 2.0 ]

Clear della console

In questo articolo viene illustrato un modo per fare il clear della console. L'articolo si riferisce anche a VB 2005 dove però è possibile utilizzare il metodo System.Console.Clear() introdotto con .NET 2.0. How to clear the Console window with Visual Basic .NET or Visual Basic 2005http://support.microsoft.com/kb/319239

posted @ mercoledì 15 marzo 2006 13:32 | Feedback (1) | Filed Under [ Links Tips .NET Framework .NET Framework 2.0 ]

KB ASP.NET 2.0 & VB.NET

How to use virtual path providers to dynamically load and compile content from virtual paths in ASP.NET 2.0http://support.microsoft.com/kb/910441 How to enable the "Option Strict" and "Option Explicit" statements in Visual Basic applicationshttp://support.microsoft.com/kb/911793

posted @ lunedì 13 marzo 2006 11:30 | Feedback (1) | Filed Under [ Links .NET Framework .NET Framework 2.0 ASP ]

KB .NET e SQL Server CE

How to use Visual C++ .NET to detect the .NET Framework versions and service packs that are installed on the computerhttp://support.microsoft.com/kb/914135 How to build an OLE DB application for SQL Server CE in Visual Studio 2005 http://support.microsoft.com/kb/914174

posted @ mercoledì 1 marzo 2006 09:47 | Feedback (3) | Filed Under [ Links .NET Framework .NET Framework 2.0 ]

KB .NET, VS 2005

How to add SOAP client functionality to native Win32 applications by using managed SOAP classeshttp://support.microsoft.com/kb/908574/en-us A new project contains build errors when you use a template that you exported from a project if the name of the old project contains space characters or other invalid identifying characters in Visual Studio 2005http://support.microsoft.com/kb/907754/en-us

posted @ lunedì 13 febbraio 2006 15:43 | Feedback (1) | Filed Under [ Links .NET Framework .NET Framework 2.0 ]

Alcuni utili articoli su Navision

How to integrate Navision 4.00 with external development projects (31/01/2006) https://mbs.microsoft.com/partnersource/documentation/howtoarticles/integratenavision400.htm?printpage=false .NET Development with Navision (13/05/2004)https://mbs.microsoft.com/partnersource/products/navision/documentation/whitepapers/netdevelopmentnavision.htm?printpage=false Microsoft Business Solutions–Navision 4.00 Smart Tag Integration Toolkit (07/09/2005)https://mbs.microsoft.com/partnersource/documentation/userguides/navdocsmarttag.htm?printpage=false Security Hardening Guide (07/08/2005)https://mbs.microsoft.com/partnersource/products/navision/documentation/userguides/2f6765b6-3a2e-494d-87ff-65188e66aa88.htm?printpage=false Granule List with included objects for Microsoft Navision Version 4.0 (14/02/2005)https://mbs.microsoft.com/partnersource/documentation/installationsetupguides/microsoft+navision+4.0+granule+list.htm?printpage=false

posted @ venerdì 3 febbraio 2006 17:07 | Feedback (1) | Filed Under [ Links Security Navision .NET Framework ]

Articoli KB

Naming conventions in Active Directory for computers, domains, sites, and OUshttp://support.microsoft.com/kb/909264/en-us How to use the Filever.exe tool to obtain specific information about a file in Windowshttp://support.microsoft.com/kb/913111/en-us Microsoft Deploying .NET Applications Lifecycle Guidehttp://support.microsoft.com/kb/913507/en-us How to use the IISADMPWD password change pageshttp://support.microsoft.com/kb/907271/en-us

posted @ martedì 24 gennaio 2006 12:35 | Feedback (2) | Filed Under [ Links Security IT .NET Framework .NET Framework 2.0 ]

MSDN Library Gennaio 2006

L'MSDN Library di Gennaio 2006 sarà l'ultima edizione che si integrerà automaticamente in Visual Studio 2003 dal momento che è l'ultima edizione che include documentazione per Visual Studio 2003 e .NET Framework 1.1.Le successive edizioni si integreranno automaticamente solo con Visual Studio 2005, sarà però possibile avere più versioni dell'MSDN Library (per esempio quella del Gennaio 2006 e una delle successive) oppure impostare manualmente l'integrazione con MSDN Library in Visual Studio 2003 tramite: Tools->Options Environment->Help Preferred Collection Dopo l'impostazione riavviare Visual Studio 2003

posted @ giovedì 19 gennaio 2006 17:18 | Feedback (1) | Filed Under [ Tips .NET Framework ]

Articoli KB SQLServer 2005 e Porta Seriale

How to detect the status of the SQL Server Express service or start the SQL Server Express service by using Visual Basic or Visual C#http://support.microsoft.com/kb/912426/en-us How to access serial ports by using Visual Basic 2005http://support.microsoft.com/kb/904795/en-us

posted @ lunedì 9 gennaio 2006 10:42 | Feedback (2) | Filed Under [ Links Database .NET Framework .NET Framework 2.0 ]

Articoli KB sulla security e performance del Framework

HOW TO: Troubleshoot Problems That Are Caused by the .NET Framework Security Configurationhttp://support.microsoft.com/default.aspx?scid=kb;en-us;815163 How to back up and restore .NET Framework configuration and security policy files http://support.microsoft.com/default.aspx?scid=kb;en-us;815168 HOW TO: Build and Deploy a .NET Security Policy Deployment Packagehttp://support.microsoft.com/default.aspx?scid=kb;en-us;815173 Microsoft .NET Framework configuration files in a side-by-side installation environment http://support.microsoft.com/default.aspx?scid=kb;en-us;815441 INFO: Deploy an Enterprise Security Policy Before You Install the .NET Framework http://support.microsoft.com/default.aspx?scid=kb;en-us;816641 HOW TO: Use the Performance Administration Tool to Analyze Performance of .NET Framework-based Windows Applicationhttp://support.microsoft.com/default.aspx?scid=kb;en-us;815158

posted @ lunedì 5 dicembre 2005 17:11 | Feedback (3) | Filed Under [ Links Security IT .NET Framework ]

Scaricare un file da una pagina web

Private Sub DownloadFile(ByVal url As String, ByVal filePath As String)      Dim webRequest As System.Net.WebRequest = System.Net.HttpWebRequest.Create(url)     Dim webResponse As System.Net.WebResponse = webRequest.GetResponse()     Dim inputStream As System.IO.Stream = webResponse.GetResponseStream()      Dim buffer(CInt(webResponse.ContentLength) - 1) As Byte     inputStream.Read(buffer, 0, buffer.Length)      inputStream.Close()     webResponse.Close()     inputStream = Nothing     webResponse = Nothing     webRequest = Nothing      Dim fileStream As New System.IO.FileStream(filePath, IO.FileMode.CreateNew)     Dim outputStream As New System.IO.BinaryWriter(fileStream)      outputStream.Write(buffer)      buffer = Nothing     outputStream.Close()     fileStream.Close()     outputStream = Nothing     fileStream = Nothing End Sub

posted @ venerdì 18 novembre 2005 19:40 | Feedback (1) | Filed Under [ Code & Snippet .NET Framework ]

Come ricavare il colore del pixel puntato dal mouse

E' stato pubblicato un'articolo sulla KB per realizzare la feature in oggetto in C# che fa uso di PInvoke: How to use Visual C# to obtain the color of the pixel that is referenced by the mouse pointerhttp://support.microsoft.com/default.aspx?scid=kb;en-us;892462

posted @ martedì 15 novembre 2005 10:14 | Feedback (1) | Filed Under [ Links Code & Snippet .NET Framework ]

Manuali Navision 4.0 e SP1

Chi ha l'accesso al PartnerSource in quanto Partner MBS fino al 30 puù scaricare dalla sezione Training & Certification i seguenti manuali gratuitamente: 8404B: Navision 4.0 Service Pack 1 Installation and Configuration 8360B: Navision 4.0 Service Pack 1 Manufacturing I 8361B: Navision 4.0 Service Pack 1 Manufacturing II 8388B: Navision 4.0 Service Pack 1 Inventory Costing 8389B: Navision 4.0 Service Pack 1 Manufacturing Costing 8359B: Navision 4.0 Service Pack 1 C/SIDE Introduction Inoltre nella sezione Download & Updates -> Product Release e' disponibile l'immagine del SP1 (Inglese) nel quale c'è una soluzione C# d'esempio per utilizzare le API C/FRONT per accedere a Navision tramite applicazioni .NET.  

posted @ mercoledì 19 ottobre 2005 10:09 | Feedback (2) | Filed Under [ Navision .NET Framework ]

Versioni di .NET Framework e Visual Studio supportate su CPU a 64 bit

Dal seguente: Versions of the .NET Framework, Visual Studio, and Visual Studio .NET that are supported on 64-bit computershttp://support.microsoft.com/default.aspx?scid=kb;en-us;907750 Products x64-based computers Itanium-based computers Microsoft Visual Studio .NET (2002) No No Microsoft Visual Studio .NET (2003) Yes No Microsoft Visual Studio 2005 Yes No Microsoft .NET Framework 1.0 No No Microsoft .NET Framework 1.1 Yes Yes Microsoft .NET Framework 2.0 Yes Yes

posted @ venerdì 14 ottobre 2005 20:23 | Feedback (1) | Filed Under [ Links .NET Framework .NET Framework 2.0 ]

Avviare il Visualizzatore immagini e fax per Windows

Il Visualizzatore immagini e fax per Windows non è un'eseguibile bensì una funzionalità contenuta nella dll shimgvw.dll.Infatti se tramite Opzioni Cartella andiamo a vedere quale applicazione viene aperta quando in espora risorse facciamo doppio click su un file immagine notiamo che viene utilizzata la seguente:rundll32.exe C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen %1 Quindi possimao scrivere un codice di questo tipo per aprire un'immagine tramite il Visualizzatore: Dim p As New System.Diagnostics.Processp.StartInfo.FileName = "rundll32.exe"p.StartInfo.Arguments = System.IO.Path.Combine(System.Environment.SystemDirectory, "shimgvw.dll")p.StartInfo.Arguments &= ",ImageView_Fullscreen"p.StartInfo.Arguments &= " E:\MyImg.gif"p.StartInfo.UseShellExecute = Falsep.StartInfo.Verb = "open"p.Start() Analogamente è possibile stampare su una stampate a scelta: Dim p As New System.Diagnostics.Processp.StartInfo.FileName = "rundll32.exe"p1.StartInfo.Arguments = System.IO.Path.Combine(System.Environment.SystemDirectory, "shimgvw.dll")p.StartInfo.Arguments &= ",ImageView_PrintTo /pt"p.StartInfo.Arguments &= "...

posted @ martedì 11 ottobre 2005 20:45 | Feedback (8) | Filed Under [ Code & Snippet .NET Framework ]

KB Come utilizzare la NotifyIcon

How to use the Windows Forms NotifyIcon component in Visual Basic .NET to display an icon for an application in the notification areahttp://support.microsoft.com/?scid=kb;en-us;903898

posted @ lunedì 3 ottobre 2005 10:00 | Feedback (3) | Filed Under [ Links Code & Snippet .NET Framework ]

Microsoft Download 19-08-2005

ILMerge ILMerge is a utility for merging multiple .NET assemblies into a single .NET assembly. It works on executables and DLLs alike. It comes with several options for controlling the processing and format of the output (8/15/2005).   Principles of Service Design: Document Centric Pattern Create a simple-to-use, well-defined contract that remains compliant with service orientation design tenets (8/17/2005). ...

posted @ martedì 30 agosto 2005 15:33 | Feedback (2) | Filed Under [ Links Security Design IT .NET Framework .NET Framework 2.0 ]

Creare una share di rete tramite WMI

Tramite il seguente codice è possibile creare una share di rete senza fare ricorso alle Api (ovviamente con performance minori rispetto a quest'ultime).I sistemi operativi supportati sono: Windows Server 2003 Windows XP Windows 2000 Professional/Server Windows NT Workstation/Server 4.0 SP4 e successivi Dim path As New System.Management.ManagementPath("Win32_Share")Dim share As New System.Management.ManagementClass(Nothing, path, Nothing) Dim inArgs As System.Management.ManagementBaseObjectinArgs = share.GetMethodParameters("Create")inArgs("Path") = "C:\MyFolder"inArgs("Name") = "ShareName" '"ShareName$" for hide shareinArgs("Type") = 0inArgs("MaximumAllowed") = NothinginArgs("Description") = Nothing Dim outArgs As System.Management.ManagementBaseObjectoutArgs = share.InvokeMethod("Create", inArgs, Nothing) inArgs.Dispose() : inArgs = NothingoutArgs.Dispose() : outArgs = Nothingshare.Dispose() : share = Nothingpath = Nothing Per maggiori info sul metodo create della...

posted @ martedì 30 agosto 2005 10:51 | Feedback (2) | Filed Under [ Code & Snippet IT .NET Framework ]

KB 31-07-2005

Visual Studio .NET 2003  http://support.microsoft.com/default.aspx?scid=kb;en-us;890940FIX: The strupr function may not convert strings to uppercase in Visual Studio .NET 2003   http://support.microsoft.com/default.aspx?scid=kb;en-us;900925FIX: An access violation may occur when you try to read a .pdb file by using the Debug Interface Access SDK that is included with Visual Studio .NET 2003   http://support.microsoft.com/default.aspx?scid=kb;en-us;903075FIX: An additional line appears at the start of the message body when you build MFC ISAPI extensions in Visual Studio .NET 2003  SQL Server 2000 http://support.microsoft.com/default.aspx?scid=kb;en-us;899431FIX: An access violation occurs in the Mssdi98.dll file, and SQL Server crashes when you use SQL Query Analyzer to debug a stored procedure in SQL...

posted @ martedì 9 agosto 2005 10:43 | Feedback (1) | Filed Under [ Links Security Database IT .NET Framework ]

KB 31-07-2005

.NET Framework 1.1  http://support.microsoft.com/default.aspx?scid=kb;en-us;903645BUG: A System.NullReferenceException exception occurs when an instance of a DataSet typed object is serialized when multiple threads access the same instance of a DataSet typed object synchronously   ASP.NET 1.1 http://support.microsoft.com/default.aspx?scid=kb;895552How to configure the ASPNET account to send an E-mail by using the System.Web.Mail namespace  Visual C++ .NET 2003  http://support.microsoft.com/default.aspx?scid=kb;en-us;899149  You cannot call the fwrite function to write to a buffer that is larger than 64 MB in Visual C++ .NET 2003 or in Visual C++ .NET 2002   Visual Studio .NET 2003  http://support.microsoft.com/default.aspx?scid=kb;en-us;886701FIX: The J# class library ZipEntry.getTime() method returns a modification time that is incorrect in Visual...

posted @ mercoledì 3 agosto 2005 20:46 | Feedback (2) | Filed Under [ Links Security Database IT .NET Framework ]

Microsoft Downloads 29-07-2005

Microsoft Pre-Release Software Code Named "Avalon" and "Indigo" Beta1 RC (ISO) Microsoft has provided a version of the Avalon and Indigo Beta1 "RC" for the general public (7/22/2005).   Microsoft Pre-Release Software WinFX Runtime Components Beta1 Microsoft has provided a version of the WinFX Runtime Components Beta1 for the general public (7/27/2005).   Microsoft WinFX SDK Web Setup The WinFX SDK contains documentation, samples and tools designed to help you develop managed applications and libraries using WinFX, which is the set of next-generation managed APIs provided by Microsoft (7/29/2005).   Encoding with DRM Samples Samples for "Developing a License Provider Service for Windows" (7/22/2005).   ...

posted @ mercoledì 3 agosto 2005 20:14 | Feedback (2) | Filed Under [ Links Database IT .NET Framework ]

Impersonate e DuplicateToken

Stavo facendo dei test sull'Impersonate e confrontando alcuni esempi (quello trovato sul libro di Balena versione 2003 e quello trovato su MSDN http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemSecurityPrincipalWindowsIdentityClassImpersonateTopic2.asp) mi è balzata all'occhio una differenza ovvero l'uso della funzione DuplicateToken.L'esempio di MSDN ne faceva uso mentre quello riportato sul libro di balena no. La spiegazione sta in questo articolo: PRB: "Unable to Impersonate User" Error Message When You Use WindowsIdentity.Impersonate Methodhttp://support.microsoft.com/default.aspx?scid=KB;EN-US;319615 SYMPTOMSWhen you use the System.Security.Principal.WindowsIdentity.Impersonate method, you may receive the following error message: Unable to impersonate user. CAUSEThis problem occurs because of the type of token that is used when the WindowsIdentity object is created. You receive the...

posted @ martedì 2 agosto 2005 19:13 | Feedback (4) | Filed Under [ .NET Framework ]

KB 17-07-2005

.NET Framework 1.1 http://support.microsoft.com/?kbid=899918How and why session IDs are reused in ASP.NET   http://support.microsoft.com/?kbid=901372FIX: You may receive a "cannot be converted to a 'uint'" error message when you use the Aximp.exe utility in Visual Studio .NET 2003   http://support.microsoft.com/?kbid=897296How to adjust security settings for Framework applications that are running from a network share   http://support.microsoft.com/?kbid=896181FIX: You receive an "Unable to generate a temporary class" error message in Internet Explorer when you try to open an ASP.NET page that consumes Web services in the .NET Framework 1.1  Visual C# .NET 2003  http://support.microsoft.com/?kbid=896416FIX: The IDE stops responding when you change a C# source file while a tool...

posted @ martedì 26 luglio 2005 18:54 | Feedback (4) | Filed Under [ Links Database IT .NET Framework ]

Microsoft Downloads 22-07-2005

Upgrading Microsoft Visual Basic 6.0 to Microsoft Visual Basic .NET Upgrading Microsoft Visual Basic 6.0 to Microsoft Visual Basic .NET is the complete technical guide to upgrading Visual Basic 6 applications to Visual Basic .NET, covering all upgrade topics from APIs to ZOrders (7/14/2005).   ...

posted @ martedì 26 luglio 2005 18:23 | Feedback (3) | Filed Under [ Links IT .NET Framework ]

Microsoft Downloads 15-07-2005

MSF for CMMI Process Improvement This download includes the MSF for CMMI Process Improvement process template (process guidance only), which is a highly iterative, adaptive planning, agile software development process that meets the requirements for the Software Engineering Institute's (SEI) Capability Maturity Model Integration (CMMI) level 3 and provides a smooth transition all the way to level 5 (7/8/2005). Creating a Capital Expenditure Model with Visual Studio 2005 Tools for Office and Excel 2003 Using Visual Basic and C# Microsoft Office Excel is a tool that is used for many different tasks that range from quick, simple spreadsheets to broad, complex...

posted @ venerdì 22 luglio 2005 09:59 | Feedback (1) | Filed Under [ Links Security IT .NET Framework ]

KB 17-07-2005

.NET Framework 1.1 http://support.microsoft.com/default.aspx?scid=kb;en-us;901183How to call a Web service by using a client certificate for authentication in an ASP.NET Web application http://support.microsoft.com/default.aspx?scid=kb;en-us;899918How and why session IDs are reused in ASP.NET SQL Server 2000  http://support.microsoft.com/default.aspx?scid=kb;en-us;902388Event ID: 208 may be logged, and a "DBCC failed" error message is logged when you try to use the Database Maintenance Plan Wizard to create a maintenance plan in SQL Server 2000   http://support.microsoft.com/default.aspx?scid=kb;en-us;899580The Full Text resource fails when you install a new clustered instance after you apply SQL Server 2000 Service Pack 4 to an existing clustered instance  Internet Security and Acceleration Server 2004  http://support.microsoft.com/default.aspx?scid=kb;en-us;895135Valid secondary MMSU streaming...

posted @ venerdì 22 luglio 2005 09:52 | Feedback (3) | Filed Under [ Links Security Database IT .NET Framework ]

Superato esame 70-306 Developing and implementing windows applications with VB.NET

Il mio punteggio (975/1000) non è certo da paragonare a quello di Raffaele (ho pagato il fatto dinon utilizzare le classi native per la stampa ma il Crystal che ovvimente non essendo un prodotto Microsoft non è materia d'esame). Ma visto che avevo solo tre settimane di tempo prima della chiusura di Prometric per pausa estiva e che un esame della cerchia Business Solutions non sarei riuscito a preparalo, mi reputo soddisfatto. Per la preparazione devo dire che nonostante utilizzi VB.NET sin dalla beta 2 della versione 2002 ho riguardato alcuni argomenti tra cui: Sicurezza CAS (i due articoli di Raffaele sono...

posted @ martedì 19 luglio 2005 19:52 | Feedback (117) | Filed Under [ .NET Framework ]

KB 10-07-2005

Visual Basic .NET 2003 http://support.microsoft.com/default.aspx?scid=kb;en-us;897298You receive an "unhandled exception of type 'System.Runtime.InteropServices.SEHException'" error message when you call the Application.EnableVisualStyles method in Visual Basic .NET 2003 and in Visual Basic 2002 Visual Studio .NET 2003 http://support.microsoft.com/default.aspx?scid=kb;en-us;898847You may receive an "Access is denied" error message when you try to perform managed remote debugging on a computer that has Visual Studio .NET 2003 installed .NET Framework 1.1 http://support.microsoft.com/default.aspx?scid=kb;en-us;896665FIX: A Windows Forms-based application may stop responding when you make a call to the Control.Invoke method in the .NET Framework 1.1 SP1 http://support.microsoft.com/default.aspx?scid=kb;en-us;901183How to call a Web service by using a client certificate for authentication in...

posted @ giovedì 14 luglio 2005 10:31 | Feedback (2) | Filed Under [ Links Security Database IT .NET Framework ]

Caricare un PictureBox con un file utilizzando un MemoryStream

Caricando il PictureBox utilizzando un MemoryStream si evita di tenere bloccato il file. 'Caricamento file nel BufferDim fs As New System.IO.FileStream("E:\Test.bmp", IO.FileMode.Open, IO.FileAccess.Read)Dim buffer(CInt(fs.Length) - 1) As Byte fs.Read(buffer, 0, CInt(fs.Length))fs.Close() : fs = Nothing 'Caricamento Buffer nel MemoryStreamDim ms As New System.IO.MemoryStream(buffer)buffer = Nothing 'Lettura immagine da MemoryStreamMe.PictureBox1.Image = System.Drawing.Image.FromStream(ms)

posted @ martedì 12 luglio 2005 18:11 | Feedback (2) | Filed Under [ Code & Snippet .NET Framework ]

Microsoft Downloads 08-07-2005

Sample Code Generator Use the XSD Object Generator Tool to generate sample Microsoft Visual C# and Visual Basic classes from an XSD schema (6/30/2005). patterns & practices Enterprise Library (June 2005) This release of Enterprise Library includes: Caching Application Block, Configuration Application Block, Cryptography Application Block, Data Access Application Block, Exception Handling Application Block, Logging and Instrumentation Application Block, and Security Application Block (7/1/2005). Visual Studio 2005 Tools for Office Beta 2 IntelliSense Code Snippets This download contains 71 IntelliSense code snippets for use with Visual Studio 2005 Tools for Office Beta 2 (7/1/2005). Live Meeting 2005 Document: Live Meeting 2005 API Reference...

posted @ martedì 12 luglio 2005 10:29 | Feedback (2) | Filed Under [ Links Security Database IT .NET Framework .NET Framework 2.0 ]

KB 06-07-2005

Visual Studio .NET 2003 http://support.microsoft.com/default.aspx?scid=kb;en-us;900410FIX: You may receive an "Optimization failed" error message when you build a C++ application that uses the <= logical operator in Visual Studio .NET 2003 Visual Basic .NET 2003 http://support.microsoft.com/default.aspx?scid=kb;en-us;897297How to consume assemblies that are located in a folder that is different from the application base folder in Visual Basic .NET http://support.microsoft.com/kb/818362How to programmatically set NTFS file system folder permissions by using ADSI in Microsoft Visual Basic .NET Visual C++ .NET 2003  http://support.microsoft.com/default.aspx?scid=kb;en-us;901374FIX: A form may take a long time to open when the form contains lots of controls in the Visual C++ .NET 2003 designer  SQL...

posted @ mercoledì 6 luglio 2005 10:11 | Feedback (3) | Filed Under [ Links Database IT .NET Framework ]

Microsoft Downloads 01-07-2005

Hotfix for SQL Server 2000 Reporting Services SP2 This download provides information regarding a hotfix that resolves four issues with SQL Server 2000 Reporting Services Service Pack 2 (6/24/2005). Visual Studio 2005 Beta2 Patch for Visual C++ Developers This patch updates the C++ IDE language service DLL (vcpkg.dll) to provide proper upload of usage data for the Customer Experience program (6/27/2005). Microsoft WS-I Basic Security Profile 1.0 Sample Application The Microsoft WS-I Basic Security Profile 1.0 Sample Application is a preview release of the work being done by the WS-I Sample Application Working Group members to demonstrate interoperability of secure Web services...

posted @ lunedì 4 luglio 2005 17:05 | Feedback (1) | Filed Under [ Links Security Database IT .NET Framework ]

Elencare gli applicativi installati tramite WMI

Uno snippet per elencare gli applicativi installati su un pc. Dim path As New System.Management.ManagementPath("root\cimv2")Dim options As New System.Management.ConnectionOptions 'Local Hostpath.Server = "." 'Remote Host'path.Server = "ServerName"'options.Username = "DomainName\UserName"'options.Password = "UserPassword" Dim scope As New System.Management.ManagementScope(path, options)Dim query As New System.Management.ObjectQuery("SELECT * FROM Win32_Product")Dim search As New System.Management.ManagementObjectSearcher(scope, query)Dim objectCollection As System.Management.ManagementObjectCollection objectCollection = search.Get() For Each myObject As System.Management.ManagementObject In objectCollection       Console.WriteLine(myObject.GetPropertyValue("Caption"))Next

posted @ venerdì 1 luglio 2005 19:02 | Feedback (1) | Filed Under [ Code & Snippet .NET Framework ]

KB 30-06-2005

VB.NET 2003 How to authenticate the Inbox in Exchange Server 2003 with forms-based authentication enabled by using Visual Basic .NEThttp://support.microsoft.com/default.aspx?scid=kb;en-us;891748 .NET Framework 1.1 How to run a user control assembly that is hosted on Internet Information Services (IIS) in Internet Explorerhttp://support.microsoft.com/default.aspx?scid=kb;en-us;892466 SQL Server 2000 FIX: A memory leak may occur when a client application uses the Dbmslpcn.dll shared memory network library version 2000.80.828.0 and connects to a local computer that is running SQL Server 2000http://support.microsoft.com/kb/900961 FIX: Query performance may be slower if the query contains both a GROUP BY clause and a DISTINCT keyword on the same columnhttp://support.microsoft.com/kb/892392 Windows Update How to read the Windowsupdate.log filehttp://support.microsoft.com/default.aspx?scid=kb;en-us;902093 Windows XP A...

posted @ giovedì 30 giugno 2005 10:03 | Feedback (2) | Filed Under [ Links Security Database IT .NET Framework ]

Microsoft Downloads 17-06-2005

Visual Basic Language Specification 8.0 (Beta 2)The Visual Basic Language Specification provides a complete description of the Visual Basic language 8.0 (Beta 2) (6/12/2005). eMbedded Visual C++ Upgrade Wizard for Visual Studio 2005 Beta 2 Download this add-in to Microsoft Visual Studio 2005 Beta 2 to allow upgrade of eVC projects (6/14/2005). SQL Server Migration Assistant for Oracle V1.0 The SQL Server Migration Assistant is a complete suite of tools that automates all phases of the migration process from Oracle to Microsoft SQL Server, enabling customers to migrate their databases easily and accurately (6/8/2005). Extended Security Update Inventory Tool The Extended Security Update...

posted @ giovedì 23 giugno 2005 19:14 | Feedback (2) | Filed Under [ Links Security Database IT .NET Framework ]

Microsoft Downloads 10-06-2005

Get the Windows SharePoint Services SDKDevelop solutions based on Windows SharePoint Services DirectX 9.0 SDK UpdateDownload the complete DirectX 9.0 SDK - (June 2005), which contains the DirectX 9.0c Runtime and all DirectX software required to create DirectX 9.0 compliant applications in C/C++, and C# (6/6/2005). SQL Server 2005 Express Edition - June CTP Download the Community Technology Preview (CTP) of Microsoft SQL Server 2005 Express Edition (6/7/2005). SQL Server 2005 Enterprise- June CTP Download the CTP of Microsoft SQL Server 2005 Enterprise Edition (6/7/2005). SQL Server 2005 Express Manager- June CTP Download the CTP of Microsoft SQL Server 2005 Express Manager (6/7/2005). Windows Mobile...

posted @ lunedì 13 giugno 2005 09:53 | Feedback (12) | Filed Under [ Links Design Database IT .NET Framework ]

Microsoft Downloads 03-06-2005

Microsoft Domain-Specific Language ToolsThis download contains a set of tools hosted in Microsoft Visual Studio 2005 to enable building custom designers for visual domain-specific languages. The tools include a wizard that generates a complete designer solution, a graphical designer for domain models (metamodels), and a set of code generators (5/27/2005).  Small IT Solution for Mobility v 1.0 The Small IT Solution for Mobility provides guidance on planning, building, deploying, and operating Microsoft Windows Mobile 2003 software solutions (5/26/2005). Microsoft Office Small Business Accounting 2006 Software Development Kit 1.2The Microsoft Office Small Business Accounting 2006 Software Development Kit includes documentation and samples, everything...

posted @ lunedì 6 giugno 2005 10:41 | Feedback (1) | Filed Under [ Links Design IT .NET Framework ]

Fix per VisualStudio 2003

824089   FIX: Visual Studio .NET 2003 stops responding when you build a solution that contains multiple projects 836612   FIX: Your inherited Windows Form becomes smaller when you edit it in Visual Studio .NET 2003 832534   FIX: Members of a class may not appear in the Watch window or in the Locals window in Visual Studio .NET 2003

posted @ martedì 31 maggio 2005 19:45 | Feedback (26) | Filed Under [ Links .NET Framework ]

Microsoft Downloads 27-05-2005

Word 2003 Sample: Creating a Search Application with Visual Basic .NET Download this sample to create a simple application in Microsoft Visual Basic .NET that searches a database and uses the results to populate a Microsoft Word document using XML tags or bookmarks (5/26/2005).   Microsoft Component Installer Software Development Kit (Spring 2005) Download this tool for installing necessary Microsoft Windows components that applications need to execute properly (5/23/2005).   Microsoft Pre-Release Software Code Named "Avalon" and "Indigo" Beta1 RC Download this version of the Avalon and Indigo Beta 1 release candidate for the general public (5/24/2005).   Download Microsoft Time Zone Keep track of the...

posted @ martedì 31 maggio 2005 19:07 | Feedback (2) | Filed Under [ Links Design IT .NET Framework ]

MSDN Developer Security Tour Torino

Complimenti a Raffaele e Fabio per capacità con cui hanno saputo gestire questo evento raggiungento il giusto connubio tra teoria pratica e approfondimento, senza esagerare nel dettaglio degli argomenti ma fornendo importanti spunti di riflessione per arrivare preparati all'entrata in vigore della normativa sulla sicurezza informatica. Per chi non c'era il sito da cui scaricare il materiale (che verrà ancora aggiornato nel fine settimana) è quello di Fabio Santini http://playmobil.sts.winisp.net/

posted @ venerdì 27 maggio 2005 11:08 | Feedback (1) | Filed Under [ Links Security Database .NET Framework ]

FIX: The overridden method in the inherited class does not appear in the Method Name box in Visual Basic .NET 2003

E' uscita la fix per il problema in oggetto, che al momento deve essere richiesta al supporto tecnico di Microsoft oppure attendere il prossimo service pack. Dal seguente:http://support.microsoft.com/default.aspx?scid=kb;en-us;894392 SYMPTOMSWhen you inherit a class that inherits and overrides another class in Microsoft Visual Basic .NET 2003, the overridden method in the inherited class does not appear in the Method Name box. This problem occurs when you select (Overrides) in the Class Name box of the inherited class. RESOLUTIONHotfix informationA supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it...

posted @ lunedì 23 maggio 2005 09:52 | Feedback (7) | Filed Under [ Links .NET Framework ]

Microsoft Downloads 20-05-2005

Sono stati resi disponibili alcuni utili tool: Enterprise Library 1.0 Hands-On Labs These hands-on labs for Enterprise Library are from the patterns & practices group and include eight labs in both Microsoft Visual C# and Visual Basic .NET (5/12/2005).http://go.microsoft.com/?linkid=3076887 SQL Server Health and History Tool The Microsoft SQL Server Health and History Tool (SQLH2) allows you to collect information from instances of SQL Server, store this information, and run reports against the data in order to determine how SQL Server is being used (5/19/2005).http://go.microsoft.com/?linkid=3076904 Microsoft Solution for Windows-based Hosting Version 3.0 Microsoft Solution for Windows-based Hosting Version 3.0 provides hosting service providers with...

posted @ sabato 21 maggio 2005 22:35 | Feedback (3) | Filed Under [ Links Security Design Database IT .NET Framework ]

Compatibilità dei programmi 32 bit su XP e 2003 Server a 64 bit

Dal seguente:Overview of the compatibility considerations for 32-bit programs on 64-bit versions of Windows Server 2003 and Windows XP The WOW64 subsystem creates a 32-bit environment on the x64-based versions of Windows Server 2003 and of Windows XP Professional x64 Edition. Some 32-bit programs may run slower on these operating systems than they would on 32-bit versions of Windows Server 2003 and of Windows XP. For example, a 32-bit program might run slower on Windows XP Professional x64 Edition than it would on Microsoft Windows XP Professional. Alternatively, some 32-bit programs that require lots of memory may exhibit increased performance on...

posted @ martedì 10 maggio 2005 10:11 | Feedback (1) | Filed Under [ Links IT .NET Framework ]

Label traparente su Picturebox

Se posizioniamo una Label su una Picturebox e impostiamo la proprietà BackColor della Label a System.Drawing.Color.Transparent per renderla traparente notiamo che non diventa trasparente rispetto alla Picturebox. Il motivo di questo comportamento lo troviamo su MSDN Proprietà Control.BackColor: La proprietà BackColor non supporta i colori trasparenti a meno che il bit di stile di ControlStyles.SupportsTransparentBackColor non sia impostato su true. La proprietà BackColor è una proprietà di ambiente. Una proprietà di ambiente è una proprietà di un controllo che, se non impostata, viene recuperata dal controllo padre. Per impostazione predefinita, a un controllo Button sarà associata, ad esempio, la stessa proprietà BackColor del controllo...

posted @ venerdì 29 aprile 2005 12:52 | Feedback (3) | Filed Under [ Code & Snippet Tips .NET Framework ]

Possibili problemi durante l'aggiornamento del .NET Framework con Windows Update

Dal seguente articoloYou install a software update for the .NET Framework that uninstalls previously installed software updates for the .NET Framework Consider the following scenario. You install a software update for the Microsoft .NET Framework on a computer that is running previously installed software updates for the .NET Framework. The previously installed software updates include the same files as the new software update that you will install. When you install the new software update, the files for the previously installed software updates are removed and are replaced by the files of the new software update.Note This scenario rarely occurs. Microsoft software...

posted @ mercoledì 27 aprile 2005 10:24 | Feedback (4) | Filed Under [ Links .NET Framework ]

Rilasciate le PIA per Office 2003

Office 2003 Update: Redistributable Primary Interop Assemblies is available for download http://www.microsoft.com/downloads/details.aspx?familyid=3c9a983a-ac14-4125-8ba0-d36d67e0f4ad Quelle di OfficeXp invece si possono trovare al seguente: Microsoft Office XP primary interop assemblies (PIAs) are available for download http://msdn.microsoft.com/vstudio/downloads/tools/

posted @ venerdì 22 aprile 2005 20:55 | Feedback (2) | Filed Under [ Links .NET Framework ]

Sincronizzare lo scroll orizzontale di due DataGrid

Per sincronizzare  lo scroll orizzontale di due Datagrid si può utilizzare la Reflection per accedere alla proprietà Friend del DataGrid HorizontalOffset. Il trucco sta nel ricavare nell'evento Scroll del primo DataGrid il relativo valore di HorizontalOffset e impostarlo sulla seconda DataGrid: Private Sub DataGrid1_Scroll(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.Scroll        Dim horizontalOffset1 As System.Reflection.PropertyInfo        horizontalOffset1 = Me.DataGrid1.GetType().GetProperty("HorizontalOffset", _              System.Reflection.BindingFlags.NonPublic Or _              System.Reflection.BindingFlags.GetProperty Or _              System.Reflection.BindingFlags.Instance)        Dim horizontalOffset2 As System.Reflection.PropertyInfo        horizontalOffset2 = Me.DataGrid2.GetType().GetProperty("HorizontalOffset", _              System.Reflection.BindingFlags.NonPublic Or _              System.Reflection.BindingFlags.GetProperty Or _              System.Reflection.BindingFlags.Instance)        horizontalOffset2.SetValue(Me.DataGrid2, _              horizontalOffset1.GetValue(Me.DataGrid1, Nothing), Nothing) End Sub

posted @ venerdì 22 aprile 2005 20:19 | Feedback (2) | Filed Under [ Code & Snippet .NET Framework ]

VB.NET Coding Guidelines by Cory Smith

http://addressof.com/blog/articles/CodingGuidelines.aspx

posted @ martedì 29 marzo 2005 11:29 | Feedback (36) | Filed Under [ Links Design .NET Framework ]

Textbox multiline e metodo AppendText

Se il Textbox ha la proprietà Multiline =True le seguenti due righe di codice presentano una differenza: Me.TextBox1.Text &= "Riga di test " & index & ControlChars.NewLine Me.TextBox1.AppendText("Riga di test " & index & ControlChars.NewLine) Il metodo AppendText fa in modo che il Textbox visualizzi sempre la parte finale del testo gestendo in automatico lo scroll.

posted @ domenica 27 marzo 2005 15:16 | Feedback (2) | Filed Under [ Code & Snippet .NET Framework ]

DataGrid Single Selection

Come molti di voi sapranno per far sì che sul DataGrid si possa selezionare una sola riga si ricorre spesso alla soluzione reperibile su Syncfusion.com di cui riporto di seguito il codice: Public Class MyDataGrid   Inherits DataGrid    Private oldSelectedRow As Integer    Protected Overloads Overrides Sub OnMouseMove(ByVal e As MouseEventArgs)       'don't call the base class if left mouse down       If (e.Button <> MouseButtons.Left) Then          MyBase.OnMouseMove(e)       End If   End Sub    Protected Overloads Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)      'don't call the base class if in header      Dim hti As DataGrid.HitTestInfo      hti = Me.HitTest(New Point(e.X, e.Y))      If (hti.Type = DataGrid.HitTestType.Cell) Then        If (oldSelectedRow > -(1)) Then          ...

posted @ giovedì 30 settembre 2004 20:15 | Feedback (1) | Filed Under [ Code & Snippet .NET Framework ]

Navision e .NET

Per quanti si stanno chiedendo come accedere a Navision tramite applicativi .NET qui è possibile trovare alcuni suggerimenti: http://www.mibuso.com/dlinfo.asp?FileID=353 Per inciso si sfrutta il web site portal.

posted @ sabato 18 settembre 2004 22:10 | Feedback (1) | Filed Under [ Links Navision .NET Framework ]

Sito dedicato a GDI+ e Windows Forms

Ecco un sito di un MVP dedicato a GDI+ e Windows Forms in cui trovare qualche simpatico tips. http://www.bobpowell.net

posted @ giovedì 16 settembre 2004 16:07 | Feedback (2) | Filed Under [ Links .NET Framework ]

Visual Basic 2005 Preview

Ho deciso di utilizzare questo elemento del mio Blog per creare un elenco degli articoli MSDN sulle novità di VB Net 2005 per mia e spero altrui comodità. A Sneak Preview of Visual Basic 2005 http://msdn.microsoft.com/library/en-us/dnvs05/html/vbnet2005_preview.asp Defining and Using Generics in Visual Basic 2005http://msdn.microsoft.com/library/en-us/dnvs05/html/vb2005_generics.asp Examining the My Feature in Visual Basic 2005http://msdn.microsoft.com/library/en-us/dnvs05/html/vbmy.asp My Walkthroughshttp://msdn.microsoft.com/library/en-us/dnvs05/html/MyWalkthro.asp Operator Overloading in Visual Basic 2005http://msdn.microsoft.com/library/en-us/dnvs05/html/vboperatoroverloading.asp Walkthrough: Smart Client Data in Visual Basic 2005http://msdn.microsoft.com/library/en-us/dnvs05/html/smartclient_vb2005.asp What's New in Help for Visual Basic 2005 Beta 1http://msdn.microsoft.com/library/en-us/dnvs05/html/vbhelp2005.asp

posted @ giovedì 5 agosto 2004 09:00 | Feedback (1) | Filed Under [ Links .NET Framework ]

Generazione di un file ico da un file bmp

Ecco una funzioncina nata da una domanda sul Newsgroup di Vb.Net per generare un file ico da uno bmp. Public Sub BmpToIcon(ByVal fileName As String)    Dim bitmap As System.Drawing.Bitmap = _        New System.Drawing.Bitmap(fileName)    Dim hIcon As IntPtr = bitmap.GetHicon()     Dim icon As System.Drawing.Icon = _        System.Drawing.Icon.FromHandle(hIcon)     Dim stream As IO.Stream = IO.File.OpenWrite( _        System.IO.Path.GetDirectoryName(fileName) & _        System.IO.Path.GetFileNameWithoutExtension(fileName) & ".ico")         icon.Save(stream)         stream.Close()         icon.Dispose()        bitmap.Dispose()End Sub

posted @ giovedì 29 luglio 2004 09:50 | Feedback (2) | Filed Under [ Code & Snippet .NET Framework ]

Articolo MSDN

Segnalo un articolo di MSDN che risponde ad una domanda che più volte ho visto nei NG. Come accedere agli elementi di un Windows Form da un altro Windows Form con Visual Basic .NEThttp://support.microsoft.com/?kbid=841292

posted @ venerdì 11 giugno 2004 15:16 | Feedback (2) | Filed Under [ Links .NET Framework ]

Interagire con Outlook 20003 tramite Vb.Net

Su Msdn è stato pubblicato il seguente articolo:Handy Tasks Using Microsoft Office Outlook 2003 and Visual Basic .NET Ovvero come interagire col modello ad oggetti di Outlook 2003 tramite Vb.Net

posted @ lunedì 3 maggio 2004 00:51 | Feedback (1) | Filed Under [ Links .NET Framework ]

Snippet: Ricavare il valore di una variabile in base al nome

Una delle domande che ogni tanto ricorrono nel NG di VB.NET è come ricavare il valore di una variabile conoscendo il nome. Supponendo di essere all'interno di una form ecco una soluzione al problema basata sulla Reflection: Public Variabile As String = "Valore" MsgBox(GetValueByName("Variabile"))Public Function GetValueByName(ByVal name as String) As String          Dim field As System.Reflection.FieldInfo          field = Me.GetType.GetField(name)          Return field.GetValue(Me).ToString()End Function Il metodo è estendibile comunque anche ad altri scenari.

posted @ venerdì 16 aprile 2004 20:28 | Feedback (1) | Filed Under [ Code & Snippet .NET Framework ]

Gestire i file udl

Ecco un paio di funzioni che ho scritto per creare e aprire un file udl tramite la DataLink Dialog utilizzando il namespace System.Diagnostics evitando così il reference ad AdoDb: Public Shared Function CreateUDLFile(ByVal udlFilePath As String) As Boolean            Dim file As New System.IO.FileInfo(udlFilePath)            'Creazione file            file.Create().Close()            'Apertura file            OpenUDLFile(udlFilePath)            'In caso di annullamento il file non viene generato e lo si elimina            If file.Length = 0 Then                file.Delete()                Return False            End If            Return TrueEnd Function Public Shared Sub OpenUDLFile(ByVal udlFilePath As String)            Dim process As System.Diagnostics.Process            process = System.Diagnostics.Process.Start(udlFilePath)            process.WaitForExit()                        process.Close()            process.Dispose()            process = NothingEnd Sub

posted @ mercoledì 14 aprile 2004 14:49 | Feedback (3) | Filed Under [ Code & Snippet Database .NET Framework ]

XEN un nuovo linguaggio per .NET

E' da un bel po' che sulla rete girano notizie su XEN un nuovo progetto di Microsoft Research (MSR) ovvero un nuovo linguaggio di programmazione compatibile con sistemi di tipo CLR che incorpora al suo interno XML e SQL. In altre parole un linguaggio per la manipolazione dei dati. Di seguito uno spezzone di codice XEN: public decimal AddTotal(Order orders, int zip){decimal total = 0;foreach (Item item in order[Zip == zip].item) {total += item.price * item.quantity;}return total; }Appare evidente la natura tipicamente OOP e la somiglianza con C#.Maggiori info al seguente link Microsoft Expands .Net With Xen

posted @ sabato 10 aprile 2004 10:30 | Feedback (7) | Filed Under [ Links .NET Framework ]

Riconoscere una stringa OleDb per SQLServer

Un modo per capire se una stringa OleDb si riferisce a SQLServer è quello di controllarne il provider tramite una regular expression: Public Overloads Shared Function IsSqlConnectionString(ByVal connectionString As String) As Boolean            Dim regex As New System.Text.RegularExpressions.Regex("Provider\s*=\s*SQLOLEDB[^;]*;", System.Text.RegularExpressions.RegexOptions.IgnoreCase)            Return regex.IsMatch(connectionString)End Function L'idea è ovviamente esensibile ad altri provider.

posted @ domenica 28 marzo 2004 15:11 | Feedback (1) | Filed Under [ Code & Snippet Database .NET Framework ]

Modificare un comando generato da un Commad Builder

Il CommandBuilder è un oggetto che se fosse più flessibile avrebbe sicuramente attratto maggiormente gli sviluppatori, una sua pessima abitudine è quella di invalidare le modifiche fatte ai comandi da lui generati.Per maggior info si veda il seguente:PRB: CommandBuilder Changes Modified Commands Back to Original Un modo per aggirare il problema può essere quello di clonare il comando generato ed aggiungere la modifica necessaria. Esempio: da.InsertCommand = DirectCast(DirectCast(da.InsertCommand, System.ICloneable).Clone, _                                                                               System.Data.IDbCommand)da.InsertCommand.CommandText &= "; SELECT SCOPE_IDENTITY() AS ID"da.InsertCommand.UpdatedRowSource = UpdateRowSource.FirstReturnedRecord

posted @ martedì 23 marzo 2004 20:02 | Feedback (3) | Filed Under [ Code & Snippet Database .NET Framework ]

Ricavare una stringa di connessione per SQLServer da una per OleDb

A volte torna utile utilizzare la Data Link per generare le stringhe di connessione:http://www.ugidotnet.org/tips/tips_read.aspx?ID=116La Data Link però ci restituisce una stringa di connessione per OleDb alla quale deve essere rimosso il parametro Provider per essere utilizzata per inizializzare un oggetto SqlConnection. Un modo può essere quello di utilizzare una regular expression: Public Shared Function GetSqlConnectionString(ByVal oledbConnectionString As String) As String Dim regex As New System.Text.RegularExpressions.Regex("Provider=[^;]*;", System.Text.RegularExpressions.RegexOptions.IgnoreCase) Return regex.Replace(oledbConnectionString, String.Empty) End Function  

posted @ sabato 20 marzo 2004 14:44 | Feedback (1) | Filed Under [ Code & Snippet Database .NET Framework ]

Associare un'icona da visualizzare nella Toolbox ad un controllo personalizzato

Un modo per associare ad un controllo personalizzato un'icona da visualizzare nella Toolbox è il seguente:1) Creare una bitmap di dimensione 16x16    (il colore del pixel nell'angolo in basso a sinistra rappresenta il colore trasparente) 2) Impostare il nome della bitmap a NomeControllo.bmp    o NomeNamespace.NomeControllo.bmp    se  il controllo risiede all'interno di un Namespace. 3) Impostandone la proprietà Build Action della bitmap a Embedded Resource 4) Impostare il seguente attributo sul controllo:    <System.Draving.TollboxBitmap(GetType(NomeControllo))>_    Public Class NomeControllo

posted @ mercoledì 17 marzo 2004 20:28 | Feedback (2) | Filed Under [ Code & Snippet Tips .NET Framework ]

BindingContext Trick

Quando in una form si deve gestire una tabella avente 2 o più campi i cui valori sono in relazione con i dati contenuti in un'altra tabella (xes si pensi al caso delle provincie per una semplice anagrafica che ha 2 indirizzi: abitazione e ufficio) viene spontaneo utilizzare due ComboBox bindati sulla DataTable collegata. Così facendo però i valori dei ComboBox risultano sincronizzati in quanto il BindingContext è unico per entrambi e non c'è modo di assegare valori diversi ai due controlli. La soluzione è quella di creare per il secondo ComboBox un nuovo BindingContext:combobox2.BindingContext = New System.Windows.Forms.BindingContext

posted @ mercoledì 10 marzo 2004 14:03 | Feedback (6) | Filed Under [ Code & Snippet Tips .NET Framework ]

MSDN Developer Security Roadshow

Agenda dell'evento: La sicurezza di un prodotto software non è soltanto data dall’infrastruttura circostante, ma dipende in primo luogo dal codice del programma. I programmatori hanno quindi una grande responsabilità rispetto alla sicurezza di un sistema ma non sempre sanno quali sono le azioni pratiche da compiere per far fronte a questo compito. Durante questo evento scoprirete come affrontare il problema della sicurezza dei vostri applicativi, come proteggervi dagli attacchi più comuni e come utilizzare la sicurezza del .NET Framework per scrivere codice sicuro http://www.microsoft.com/italy/eventi/msdn/roadshow_sicurezza_Aprile2004.mspx

posted @ martedì 2 marzo 2004 14:42 | Feedback (8) | Filed Under [ Links Security .NET Framework ]

Nomi sicuri e protezione in .NET Framework

Su Msdn Italia è stato pubblicato il seguente: Security Briefs: nomi sicuri e protezione in .NET Frameworkhttp://www.microsoft.com/italy/msdn/library/net/framework/strongNames.asp L'articolo vuole essere una guida alla creazione e all'utilizzo dei nomi sicuri per gli assembly.  

posted @ giovedì 26 febbraio 2004 20:32 | Feedback (3) | Filed Under [ Links Security .NET Framework ]

Come verificare se un testo può essere visualizzato in un area prefissata

Questa funzione permette di verificare se un testo è visualizzabile integralmente in un area prefissata e può essere utile nei casi in cui si voglia visualizzare un ToolTip per testi che superano lo spazio messo a disposizione da un controllo (xes. un tooltip sugli item di un ListView in modalità dettaglio il cui testo supera la larghezza della colonna) Public Function IsTextExceedSize(ByVal graphics As System.Drawing.Graphics, _                                                     ByVal text As String, _                                                     ByVal font As System.Drawing.Font,                                                      ByVal width As Integer, _                                                     ByVal height As Integer) As Boolean    Dim textSize As System.Drawing.SizeF   Dim charactersFitted, linesFitted As Integer   Dim layoutRect As New System.Drawing.SizeF(width, height)    textSize = graphics.MeasureString(text, font, layoutRect,...

posted @ lunedì 23 febbraio 2004 19:33 | Feedback (8) | Filed Under [ Code & Snippet .NET Framework ]

Ricavare i valori selezionati da un ListBox bindato

Si supponga di avere un ListBox a multiselezione su cui si è impostato DataSource, ValueMember e DisplayMember.Per ricavare i ValueMember selezionati basta notare che in questo caso gli Items sono dei DataRowView. For index As Integer = 0 To Me.ListBox1.SelectedIndices.Count - 1      With DirectCast(Me.ListBox1.Items(Me.ListBox1.SelectedIndices(index)), _                                System.Data.DataRowView)               MsgBox(.Row(Me.ListBox1.ValueMember).ToString)       End WithNext

posted @ giovedì 19 febbraio 2004 00:13 | Feedback (53) | Filed Under [ Code & Snippet .NET Framework ]

TheServerSide.NET: Una nuova comunità dedicata all'utilizzo di .NET in ambiente aziendale

TheServerSide.NET è un nuovo sito Web di comunità che offre ad architetti e sviluppatori aziendali notizie, articoli e discussioni su .NET. http://www.theserverside.net

posted @ martedì 17 febbraio 2004 10:05 | Feedback (2) | Filed Under [ Links .NET Framework ]

Snippet: Cattura dell'output di un comando DOS

Dim myProcess As New ProcessDim myProcessStartInfo As New ProcessStartInfo("cmd.exe")myProcessStartInfo.Arguments = "/C dir c:"myProcessStartInfo.UseShellExecute = FalsemyProcessStartInfo.RedirectStandardOutput = TruemyProcess.StartInfo = myProcessStartInfomyProcess.Start()Console.WriteLine(myProcess.StandardOutput.ReadToEnd)myProcess.Close()

posted @ sabato 14 febbraio 2004 17:38 | Feedback (262) | Filed Under [ Code & Snippet .NET Framework ]

L'attributo AmbientValue

Shawn Burke in un thread su .NET 247 chiarisce l'utilizzo dell'attributo AmbientValue: Shawn Burke [MSFT] AmbientValueAttribute is for properties that inherit settings from other places. For example the Font or Cursor properties on Control will report their Parent's value if they aren't set. But the code generation engine doesn't know this. The most common place that we use this is undo/redo. Say you add a Button to a Form. The Button will get the same Font as the form has -- it inherits that value. But since no value has actually been set, the codegen engine still doesn't want to generate code for...

posted @ mercoledì 11 febbraio 2004 20:28 | Feedback (57) | Filed Under [ .NET Framework ]

Windows Application Verifier

In questo articolo viene descritto un tool per la verifica e l'individuazione di errori comuni nelle applicazioni. http://www.microsoft.com/italy/msdn/library/net/vsnet/secure12112003.asp

posted @ martedì 10 febbraio 2004 20:15 | Feedback (2) | Filed Under [ Links .NET Framework ]

Appunti su Longhorn Preview

Al Longhorn Developer Preview dello scorso 6 Febbraio sono state date delle anticipazioni sulle nuove tecnologie contenute in Longhorn e su come sviluppare oggi applicazioni con un occhio al futuro. Innazitutto si è tenuto a precisare che queste nuove tecnologie affiancheranno quelle esistenti , quindi le applicazioni legacy continueranno a funzionare, ma che i presupposto per sviluppare le applicazioni di domani è quello di utilizzare codice gestito. Longhorn si baserà su 3 tecnologie:- Avalon per la gestinone dell'interfaccia grafica e della multimedialità;- Indigo che si occuperà della comunicazione;- WinFS dedicato alla gestione dei dati;Queste tecnologie a loro volta si baseranno su un nuovo...

posted @ lunedì 9 febbraio 2004 19:56 | Feedback (2) | Filed Under [ IT .NET Framework ]

Provider Controls vs Inheritance

In questo articolo Dino Esposito propone un modo alternativo all'eredità per personalizzare i controlli: i provider controls. http://msdn.microsoft.com/msdnmag/issues/03/11/CuttingEdge/

posted @ mercoledì 4 febbraio 2004 14:02 | Feedback (2) | Filed Under [ Links .NET Framework ]

PropertyGrid: gestione delle date nulle

Ha volte capita di voler gestire tramite il controllo PropertyGrid delle date i cui valori sono memorizzati in un database, diventa quindi necessario gestire il caso della data nulla. Si supponga  di avere la seguente tabella:Config    ID (PK String)    Data (Date) per cui si è proveduto a generare una DataTest tipizzato ConfigSchema contenente la DataTable tipizzata Config.Per poter gestire i dati tramite un PropertyGrid è necessario costruirsi una Classe wrapper avente due proprietà ID e Data: Public Class ConfigWrapper    Private _Row As ConfigSchema.ConfigRow     Public Sub New(ByVal row As ConfigSchema.ConfigRow)        Me._Row = row    End Sub     Public Property ID() As String        Get            Return Me._Row.ID        End...

posted @ domenica 1 febbraio 2004 21:42 | Feedback (4) | Filed Under [ Code & Snippet .NET Framework ]

Simulare l'evento Validating

A volte può capitare (almeno a me) di utilizzare l'evento Validanting per delle decodifiche (xes IDCliente - RagioneSociale) appare chiaro che in situazioni come questa sarebbe utile avere una funzione PerformValidating, che invochi l'elaborazione contenuta nell'evento e ci dica se la validazione è riuscita o meno, da utilizzare quando modifichiamo il record per evitare la ripetizione del codice di decodifica o tortusi escamotage per richiamare la funzione a cui è collegato l'evento Validating. Un modo per ottenere tale risultato può essere quello di ricorrere alla Reflection: Function PerformValidating(ByVal control As System.Windows.Forms.Control) As Boolean       control.Focus()       Dim method As System.Reflection.MethodInfo       method = control.GetType.GetMethod("OnValidating", _                       ...

posted @ lunedì 26 gennaio 2004 12:41 | Feedback (5) | Filed Under [ Code & Snippet Tips .NET Framework ]

Tutto quello che avreste voluto sapere sull'Owner-Drawing

http://msdn.microsoft.com/msdnmag/issues/04/02/CuttingEdge/default.aspx In questo articolo Dino Esposito tratta in maniera approfondita i seguenti argomenti:- Customizing Menu Rendering- Overriding the Menu of a Form- The MeasureItem Event- The DrawItem Event- Painting the Menu Item- Context Menu and TextBoxes- Using Graphical Menus Seamlessly e risponde implicitamente ad un mio dubbio circa la possibilità di personalizzare il context menu di default del TextBox: The Textbox is the only control in Windows Forms that has a built-in context menu. The control exposes a ContextMenu property, but it doesn't return an instance of the context menu that appears when you right-click. Why? The code for the textbox's context menu...

posted @ venerdì 23 gennaio 2004 19:06 | Feedback (4) | Filed Under [ Links .NET Framework ]

La classe System.Windows.Forms.SystemInformation

Esplorando il Namespace System.Windows.Forms mi sono imbattuto nella classe System.Windows.Forms.SystemInformation che consente di ricavare tramite le sue proprietà Shared moltissime informazioni legate all'interfaccia utente e al sistema. Ecco alcuni esempi:        System.Windows.Forms.SystemInformation.BootMode        System.Windows.Forms.SystemInformation.MouseButtons        System.Windows.Forms.SystemInformation.MousePresent        System.Windows.Forms.SystemInformation.MouseWheelPresent        System.Windows.Forms.SystemInformation.Network        System.Windows.Forms.SystemInformation.MonitorCount        System.Windows.Forms.SystemInformation.PrimaryMonitorSize         System.Windows.Forms.SystemInformation.BorderSize        System.Windows.Forms.SystemInformation.CaptionHeight        System.Windows.Forms.SystemInformation.HorizontalScrollBarHeight        System.Windows.Forms.SystemInformation.VerticalScrollBarWidth

posted @ giovedì 22 gennaio 2004 10:42 | Feedback (5) | Filed Under [ .NET Framework ]

Powered by:
Powered By Subtext Powered By ASP.NET