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
ASP.NET 2.0 / 3.5 / 4.0
Permessi Cartella
mercoledì 19 luglio 2006 - 12.44
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
cgranata
Profilo
| Newbie
9
messaggi | Data Invio:
mer 19 lug 2006 - 12:44
Ho una situazione del genere.
Un server di dominio Windows 2003 con IIS 6 a corredo, ho un applicazione con asp 2.0.
La mia applicazione web ha la necessità di accedere ad una cartella su un altro server tipo
\\nomeserver\indici.
Quando esegue questa operazione mi da un errore
ccess to the path '\\server\BDHTML_new\Indici' is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access to the path '\\server\BDHTML_new\Indici' is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
Potete darmi una dritta?
us01739
Profilo
| Expert
641
messaggi | Data Invio:
mer 19 lug 2006 - 14:05
Prova ad utilizzare un web.config nella cartella che contiene la tua applicazione web, nella quale indichi un'utenza che potrà accedere alla cartella.
Esempio:
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<identity userName="dominio\user1" password="P@$$w0rd" impersonate="true"/>
</system.web>
</configuration>
Bye bye
---------------------------------------------------
Roberto Gelmini - Microsoft Certified Professional
www.robertogelmini.com
---------------------------------------------------
cgranata
Profilo
| Newbie
9
messaggi | Data Invio:
mer 19 lug 2006 - 17:29
Ho deciso di utilizzare il consiglio ACL, allora mi sono un po modificato il codice per farmi stampare il risultato del for
1 sulla mi macchina ottengo
FullControl
Utente:{0}NT AUTHORITY\NETWORK
Accesso:{1}Allow
FullControl
Utente:{0}CONSUL\services
Accesso:{1}Allow
FullControl
e.c.c.
se lo stesso files lo publbico sul server mi restituisce questo errore :
rrore interpretazione XML: nessun elemento trovato
Indirizzo:
http://www.wwwwsadsadl.it/demo/Quesiti.aspx
Linea numero 1, colonna 1:
la cosa che ho fatto è questa, come prima istruzione in un apagina aspx
ho messo il seguente codice.
Response.Write( testArticoli.DemoAcl.GetACLDirectory("mio percorso"));
Response.End();
cgranata
Profilo
| Newbie
9
messaggi | Data Invio:
mer 19 lug 2006 - 17:44
Nelle proprietà delle cartella l'utente NETWORK (IIS6) ha tutti i permessi per accedere
cgranata
Profilo
| Newbie
9
messaggi | Data Invio:
mer 19 lug 2006 - 17:54
sai quale è la cosa strana, e che in locale mi funziona tutto bene, quando lo pubblico mi genere l'errore.
ma con IIS6 solo all'utente NETWORK devo associare i permessi?
P.S.
La cartella che elaboro e residente su un altro server ma appartenete al dominio
sarebbe
\\mio server\cartella\sotto cartella
cgranata
Profilo
| Newbie
9
messaggi | Data Invio:
mer 19 lug 2006 - 18:01
Ancora una cosa, ho mappato sul mio pc la cartella in questione "Z:\INDIZI"
string[] sFile = System.IO.Directory.GetDirectories("Z:\\indici");
string sRet = "";
for (int i = 0; i < sFile.Length; i++)
{
sRet += sFile[i] + "<br>";
}
Response.Write(sRet);
Response.End();
facendo queste istruzioni mi stamo il contenuto delle sotto cartelle, cmq in locale funziona sempre tutto bene
ho pubblicato le modifiche mappando anche la cartella anche sul server e mi da il seguente errore
System.IO.DirectoryNotFoundException: Could not find a part of the path 'Z:\indici'.
us01739
Profilo
| Expert
641
messaggi | Data Invio:
gio 20 lug 2006 - 08:01
Prova ad aggiungere negli utenti anche everyone.
Sò che è poco elegante, ma l'utente network è un utente locale, quindi se IIS non è sulla stessa macchina non funziona.
e poi: è un errore di scrittura ho hai mappato due risorse diverse? INDIZI e INDICI
Bye Bye
---------------------------------------------------
Roberto Gelmini - Microsoft Certified Professional
www.robertogelmini.com
---------------------------------------------------
cgranata
Profilo
| Newbie
9
messaggi | Data Invio:
gio 20 lug 2006 - 09:16
per la mappatura è solo un errore di trascrizione...
cgranata
Profilo
| Newbie
9
messaggi | Data Invio:
gio 20 lug 2006 - 10:39
Ho risolto.
Nelle configurazione di IIS6, nel pool di applicazioni nella sezione Identità, c'era impostato come servizio locale ho cambiato in servizio di rete e la cosa si è risolta.
GRAZIE 1.000
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 !