Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
.NET Framework
Trovare cartella di windows framework 2.0
martedì 17 gennaio 2006 - 17.53
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
Gho5t
Profilo
| Junior Member
155
messaggi | Data Invio:
mar 17 gen 2006 - 17:53
ciao a tutti...
vorrei sapere come posso trovare la cartella di windows (es: c:\Windows) in automatico tramite il framework senza doverla digitare di persona.
Grazie mille a chiunque penserà a come risolvere questo problema
totti240282
Profilo
| Guru
1.574
messaggi | Data Invio:
mar 17 gen 2006 - 21:36
Dovresti vedere la classe environment dovrebbe esserci la proprietà special folder.....
C'è solo un capitano !!!!!!
totti240282
Profilo
| Guru
1.574
messaggi | Data Invio:
mar 17 gen 2006 - 21:38
System.Environment.SpecialFolder.System
C'è solo un capitano !!!!!!
Gho5t
Profilo
| Junior Member
155
messaggi | Data Invio:
mer 18 gen 2006 - 09:43
Già avevo visto quella funzione.. però mi ritorna "c:\Windows\System32"....
io invece vorrei trovare solamente "c:\Windows"
Avete qualche altro suggerimento?
UN UOMO NON MUORE PER QUALCOSA IN CUI NON CREDE
totti240282
Profilo
| Guru
1.574
messaggi | Data Invio:
mer 18 gen 2006 - 10:25
bè da li è facile ti fai una piccola funzioncina e hai risolto !!!!
C'è solo un capitano !!!!!!
Gho5t
Profilo
| Junior Member
155
messaggi | Data Invio:
gio 19 gen 2006 - 15:37
ho trovato questo script che inizialmente era per vb6, poi l'ho aggiustato per .net..
Private Declare Function GetWindowsDirectory Lib "kernel32.dll" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Public Function GetTheWindowsDirectory() As String
Dim strWindowsDir As String ' Variable to return the path of Windows Directory
Dim lngWindowsDirLength As Long ' Variable to return the the lenght of the path
strWindowsDir = Space(250) ' Initilize the buffer to receive the string
Dim ip As Long = 250
lngWindowsDirLength = GetWindowsDirectory(strWindowsDir, ip) ' Read the path of the windows directory
strWindowsDir = strWindowsDir.Substring(0, 255)
Return strWindowsDir
End Function
effettivamente mi restituisce c:\Windows ....
però mi da un'errore nella riga in cui richiamo "GetWindowsDirectory(strWindowsDir, ip)" molto strano:
"A call to PInvoke function 'Zip!Zip.frmMain::GetWindowsDirectory' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature."
qualcuno mi può aiutare???
UN UOMO NON MUORE PER QUALCOSA IN CUI NON CREDE
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !