Thursday, March 29, 2012
PERFORMANCE QUESTION
is the best way ? Using a Xml file to store languages and their
corresponding fields or Using a MS-SQL Database ?
What do you recommend me to have best performance about multilanguage
web-sites?if you are worried about performance, the localized content should be stored
in the cache, which means whether you use XML or a database, the performance
will be excellent.
Karl
--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Savas Ates" <in da club> wrote in message
news:OsYNsoBVGHA.5500@.TK2MSFTNGP12.phx.gbl...
>I want to built a web page which is gonna have multiple languages. Which
>one is the best way ? Using a Xml file to store languages and their
>corresponding fields or Using a MS-SQL Database ?
> What do you recommend me to have best performance about multilanguage
> web-sites?
>
It really depends. For large numbers of records, SQL will far outperform
XML. Parsing XML is a relatively slow thing. If you are going to have 10K
records with information regarding different words in different languages,
XML is going to be slow, and so will XPath.
If you have 200 records, well, maybe it doesn't matter as much.
Also, you can use Access as your database, which is file based, so similar
to an XML file in that regard.
You should look at your situation, and see what works best for you. The key
is to box up all the translation code into some methods, so if you switch
implementations, only those few methods have to change.
"Savas Ates" <in da club> wrote in message
news:OsYNsoBVGHA.5500@.TK2MSFTNGP12.phx.gbl...
>I want to built a web page which is gonna have multiple languages. Which
>one is the best way ? Using a Xml file to store languages and their
>corresponding fields or Using a MS-SQL Database ?
> What do you recommend me to have best performance about multilanguage
> web-sites?
>
File I/O is simple and no network operation needed... But again if you are
delpoying to a server, will it be easy to get deployed and get read access
or read-write for the XMLfile?
personally i will go with DB, if your application is already using a
Database for other purposes.. the reason is updating is easy... or else you
have to find ways to deploy the new XML file to the server... might be
painful sometimes..
if you don't have a DB in the app... do a XML file...
VJ
"Savas Ates" <in da club> wrote in message
news:OsYNsoBVGHA.5500@.TK2MSFTNGP12.phx.gbl...
>I want to built a web page which is gonna have multiple languages. Which
>one is the best way ? Using a Xml file to store languages and their
>corresponding fields or Using a MS-SQL Database ?
> What do you recommend me to have best performance about multilanguage
> web-sites?
>
There is a standardized feature in ASP.NET for binding the text properties
of web controls with alternate content, stored in XML based "resource
files", keyed on the language settings of the user's browser.
http://msdn2.microsoft.com/en-us/library/ms227427(VS.80).aspx
"Savas Ates" <in da club> wrote in message
news:OsYNsoBVGHA.5500@.TK2MSFTNGP12.phx.gbl...
>I want to built a web page which is gonna have multiple languages. Which
>one is the best way ? Using a Xml file to store languages and their
>corresponding fields or Using a MS-SQL Database ?
> What do you recommend me to have best performance about multilanguage
> web-sites?
>
Savas,
Is this real a question. Whatever system your choose is the only moment that
it can be from importance be as the user changes the language. As most use
the by IE returned standard information in what is the language and than a
Cookie if that changes, what is a one time operation. For the rest it is
equal to getting all kind of information.
Just my thought,
Cor
On Thu, 30 Mar 2006 20:22:04 +0200, "Cor Ligthert [MVP]"
<notmyfirstname@.planet.nl> wrote:
in <Okh2caCVGHA.5580@.TK2MSFTNGP11.phx.gbl>
>Savas,
>Is this real a question. Whatever system your choose is the only moment tha
t
>it can be from importance be as the user changes the language. As most use
>the by IE returned standard information in what is the language and than a
>Cookie if that changes, what is a one time operation. For the rest it is
>equal to getting all kind of information.
>Just my thought,
>Cor
>
Well, good that we cleared that one up a bit.
This posting is provided "AS IS" with no warranties, no guarantees, and no c
onferred rights.
Stefan Berglund
Yep, clear as mud (as Cor's posts usually are, from memory).
*mike hodgson*
http://sqlnerd.blogspot.com
Stefan Berglund wrote:
>On Thu, 30 Mar 2006 20:22:04 +0200, "Cor Ligthert [MVP]"
><notmyfirstname@.planet.nl> wrote:
> in <Okh2caCVGHA.5580@.TK2MSFTNGP11.phx.gbl>
>
>
>Well, good that we cleared that one up a bit.
>--
>This posting is provided "AS IS" with no warranties, no guarantees, and no
conferred rights.
>Stefan Berglund
>
Monday, March 26, 2012
Performing a download along with another action
1. Delete a record from a database
2. Let the user download a text file that is generated
3. Refresh the page to show that the record was deleted
I am able to do any of these things separately with no trouble. The problem
occurs when I try to offer a download AND call my refresh method. When I try
to do a download and call my refresh method, only the download is performed,
regardless of whether the refresh is called before or after the download.
Here is snippet of my code that does the download and refresh:
Me.RefreshEvents()
Response.ClearContent()
Response.ContentType = "text/plain"
Response.AddHeader("content-disposition", "attachment;filename=" &
downloadname)
Response.Write(downloadtext)
Response.End()
If I comment out five lines that do the download, Me.RefreshEvents() does
what I want and would expect, but otherwise it appears to do nothing. I
don't care whether Me.RefreshEvents() is called before or after doing the
download, as long as they are both done. What can I do to make sure both of
these tasks get completed?
--
Nathan Sokalski
njsokalski@dotnet.itags.org.hotmail.com
http://www.nathansokalski.com/when the browser requests a page (like when the user hit the button), the
browser only expects one document back. you can do one of several options
1) refesh page and enable a download button
2) refresh page and use client script to start a download
3) refresh page and use meta tag to start download
in all cases you refresh the page and then download the text file.
-- bruce (sqlwork.com)
"Nathan Sokalski" <njsokalski@.hotmail.com> wrote in message
news:OluwItk6FHA.2176@.TK2MSFTNGP14.phx.gbl...
>I have a webform that contains a button which I want to do three things:
> 1. Delete a record from a database
> 2. Let the user download a text file that is generated
> 3. Refresh the page to show that the record was deleted
> I am able to do any of these things separately with no trouble. The
> problem occurs when I try to offer a download AND call my refresh method.
> When I try to do a download and call my refresh method, only the download
> is performed, regardless of whether the refresh is called before or after
> the download. Here is snippet of my code that does the download and
> refresh:
>
> Me.RefreshEvents()
> Response.ClearContent()
> Response.ContentType = "text/plain"
> Response.AddHeader("content-disposition", "attachment;filename=" &
> downloadname)
> Response.Write(downloadtext)
> Response.End()
>
> If I comment out five lines that do the download, Me.RefreshEvents() does
> what I want and would expect, but otherwise it appears to do nothing. I
> don't care whether Me.RefreshEvents() is called before or after doing the
> download, as long as they are both done. What can I do to make sure both
> of these tasks get completed?
> --
> Nathan Sokalski
> njsokalski@.hotmail.com
> http://www.nathansokalski.com/
This can be done. What is meant by refreshing the page, something like
re-display the grid?
So the user hits the button:
1. You delete the record and re-bind the grid so the user can see the
changes on this page.
2. You save the text to be downloaded in a session variable - this is the
simplest, or on disk, or database record, etc.
3. You have a Protected string variable, say MustDownLoad, and set it's
value "Yes", or anything, to be read by Java script.
4. In the HTML view of the form, right at the bottom, you must add Java
script to open a new window to download the text:
<script language="javascript">
if ("<%=MustDownLoad%>" != "") {
window.open("Form_DownLoadText.aspx");
}
</script>
5. You create a new form Form_DownLoadText.aspx and in it, you read the text
from the session variable/disk/record and do the
Response.ClearContent()
Response.ContentType = "text/plain"
yada yada
"Nathan Sokalski" <njsokalski@.hotmail.com> wrote in message
news:OluwItk6FHA.2176@.TK2MSFTNGP14.phx.gbl...
>I have a webform that contains a button which I want to do three things:
> 1. Delete a record from a database
> 2. Let the user download a text file that is generated
> 3. Refresh the page to show that the record was deleted
> I am able to do any of these things separately with no trouble. The
> problem occurs when I try to offer a download AND call my refresh method.
> When I try to do a download and call my refresh method, only the download
> is performed, regardless of whether the refresh is called before or after
> the download. Here is snippet of my code that does the download and
> refresh:
>
> Me.RefreshEvents()
> Response.ClearContent()
> Response.ContentType = "text/plain"
> Response.AddHeader("content-disposition", "attachment;filename=" &
> downloadname)
> Response.Write(downloadtext)
> Response.End()
>
> If I comment out five lines that do the download, Me.RefreshEvents() does
> what I want and would expect, but otherwise it appears to do nothing. I
> don't care whether Me.RefreshEvents() is called before or after doing the
> download, as long as they are both done. What can I do to make sure both
> of these tasks get completed?
> --
> Nathan Sokalski
> njsokalski@.hotmail.com
> http://www.nathansokalski.com/
Nathan,
Maybe a stupid question, why do you not use the HTML command File Field. It
is a strange name because AFAIK mostly is used Download Button.
It is the HTML tag <Input type=file
Cor
Performing a download along with another action
1. Delete a record from a database
2. Let the user download a text file that is generated
3. Refresh the page to show that the record was deleted
I am able to do any of these things separately with no trouble. The problem
occurs when I try to offer a download AND call my refresh method. When I try
to do a download and call my refresh method, only the download is performed,
regardless of whether the refresh is called before or after the download.
Here is snippet of my code that does the download and refresh:
Me.RefreshEvents()
Response.ClearContent()
Response.ContentType = "text/plain"
Response.AddHeader("content-disposition", "attachment;filename=" &
downloadname)
Response.Write(downloadtext)
Response.End()
If I comment out five lines that do the download, Me.RefreshEvents() does
what I want and would expect, but otherwise it appears to do nothing. I
don't care whether Me.RefreshEvents() is called before or after doing the
download, as long as they are both done. What can I do to make sure both of
these tasks get completed?
--
Nathan Sokalski
njsokalski@dotnet.itags.org.hotmail.com
http://www.nathansokalski.com/when the browser requests a page (like when the user hit the button), the
browser only expects one document back. you can do one of several options
1) refesh page and enable a download button
2) refresh page and use client script to start a download
3) refresh page and use meta tag to start download
in all cases you refresh the page and then download the text file.
-- bruce (sqlwork.com)
"Nathan Sokalski" <njsokalski@.hotmail.com> wrote in message
news:OluwItk6FHA.2176@.TK2MSFTNGP14.phx.gbl...
>I have a webform that contains a button which I want to do three things:
> 1. Delete a record from a database
> 2. Let the user download a text file that is generated
> 3. Refresh the page to show that the record was deleted
> I am able to do any of these things separately with no trouble. The
> problem occurs when I try to offer a download AND call my refresh method.
> When I try to do a download and call my refresh method, only the download
> is performed, regardless of whether the refresh is called before or after
> the download. Here is snippet of my code that does the download and
> refresh:
>
> Me.RefreshEvents()
> Response.ClearContent()
> Response.ContentType = "text/plain"
> Response.AddHeader("content-disposition", "attachment;filename=" &
> downloadname)
> Response.Write(downloadtext)
> Response.End()
>
> If I comment out five lines that do the download, Me.RefreshEvents() does
> what I want and would expect, but otherwise it appears to do nothing. I
> don't care whether Me.RefreshEvents() is called before or after doing the
> download, as long as they are both done. What can I do to make sure both
> of these tasks get completed?
> --
> Nathan Sokalski
> njsokalski@.hotmail.com
> http://www.nathansokalski.com/
>
This can be done. What is meant by refreshing the page, something like
re-display the grid?
So the user hits the button:
1. You delete the record and re-bind the grid so the user can see the
changes on this page.
2. You save the text to be downloaded in a session variable - this is the
simplest, or on disk, or database record, etc.
3. You have a Protected string variable, say MustDownLoad, and set it's
value "Yes", or anything, to be read by Java script.
4. In the HTML view of the form, right at the bottom, you must add Java
script to open a new window to download the text:
<script language="javascript">
if ("<%=MustDownLoad%>" != "") {
window.open("Form_DownLoadText.aspx");
}
</script>
5. You create a new form Form_DownLoadText.aspx and in it, you read the text
from the session variable/disk/record and do the
Response.ClearContent()
Response.ContentType = "text/plain"
yada yada
"Nathan Sokalski" <njsokalski@.hotmail.com> wrote in message
news:OluwItk6FHA.2176@.TK2MSFTNGP14.phx.gbl...
>I have a webform that contains a button which I want to do three things:
> 1. Delete a record from a database
> 2. Let the user download a text file that is generated
> 3. Refresh the page to show that the record was deleted
> I am able to do any of these things separately with no trouble. The
> problem occurs when I try to offer a download AND call my refresh method.
> When I try to do a download and call my refresh method, only the download
> is performed, regardless of whether the refresh is called before or after
> the download. Here is snippet of my code that does the download and
> refresh:
>
> Me.RefreshEvents()
> Response.ClearContent()
> Response.ContentType = "text/plain"
> Response.AddHeader("content-disposition", "attachment;filename=" &
> downloadname)
> Response.Write(downloadtext)
> Response.End()
>
> If I comment out five lines that do the download, Me.RefreshEvents() does
> what I want and would expect, but otherwise it appears to do nothing. I
> don't care whether Me.RefreshEvents() is called before or after doing the
> download, as long as they are both done. What can I do to make sure both
> of these tasks get completed?
> --
> Nathan Sokalski
> njsokalski@.hotmail.com
> http://www.nathansokalski.com/
>
Nathan,
Maybe a stupid question, why do you not use the HTML command File Field. It
is a strange name because AFAIK mostly is used Download Button.
It is the HTML tag <Input type=file>
Cor
Performing issues
What is faster to IIS, a Code Behind file or a In Code aspx file?
When we call for a Class like dim f as new MyClass if it's a big class,
will it take longer to run? or the IIS only access the funcions that we call
inside the class when we call it?
Thanks
Bruno Alexandre
Kbenhavn, Danmark
"a portuguese in Denmark"An ASPX file is parsed at run-time to MSIL, which is then compiled to a
native image. A DLL is MSIL, so it takes fewer operations to compile it to a
native image. Of course, caching mechanisms make most of that moot, as the
resources are no continually being re-compiled.
HTH,
Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com
If the Truth hurts, wear it.
"Bruno Alexandre" <bruno.in.dk@.gmail.com> wrote in message
news:uL60f$E6GHA.3508@.TK2MSFTNGP06.phx.gbl...
> Hi guys,
> What is faster to IIS, a Code Behind file or a In Code aspx file?
> When we call for a Class like dim f as new MyClass if it's a big class,
> will it take longer to run? or the IIS only access the funcions that we
> call inside the class when we call it?
> Thanks
> --
> Bruno Alexandre
> Kbenhavn, Danmark
> "a portuguese in Denmark"
>
>
Hi Kevin,
but I'm not talking about DLL, only VB files (classes) and having the code
in the same page or separete one.
I dont thing that the IIS will take my hole site and put it in diferent
DLL's (there is an option in framework 2.0 that we can do that into one DLL)
but this is not my point.
Bruno Alexandre
Kbenhavn, Danmark
"a portuguese in Denmark"
"Kevin Spencer" <uce@.ftc.gov> escreveu na mensagem
news:uhr08DH6GHA.3508@.TK2MSFTNGP06.phx.gbl...
> An ASPX file is parsed at run-time to MSIL, which is then compiled to a
> native image. A DLL is MSIL, so it takes fewer operations to compile it to
> a native image. Of course, caching mechanisms make most of that moot, as
> the resources are no continually being re-compiled.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> Software Composer
> http://unclechutney.blogspot.com
> If the Truth hurts, wear it.
> "Bruno Alexandre" <bruno.in.dk@.gmail.com> wrote in message
> news:uL60f$E6GHA.3508@.TK2MSFTNGP06.phx.gbl...
>
Performing issues
What is faster to IIS, a Code Behind file or a In Code aspx file?
When we call for a Class like dim f as new MyClass if it's a big class,
will it take longer to run? or the IIS only access the funcions that we call
inside the class when we call it?
Thanks
--
Bruno Alexandre
Kbenhavn, Danmark
"a portuguese in Denmark"An ASPX file is parsed at run-time to MSIL, which is then compiled to a
native image. A DLL is MSIL, so it takes fewer operations to compile it to a
native image. Of course, caching mechanisms make most of that moot, as the
resources are no continually being re-compiled.
--
HTH,
Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com
If the Truth hurts, wear it.
"Bruno Alexandre" <bruno.in.dk@.gmail.comwrote in message
news:uL60f$E6GHA.3508@.TK2MSFTNGP06.phx.gbl...
Quote:
Originally Posted by
Hi guys,
>
What is faster to IIS, a Code Behind file or a In Code aspx file?
>
When we call for a Class like dim f as new MyClass if it's a big class,
will it take longer to run? or the IIS only access the funcions that we
call inside the class when we call it?
>
Thanks
>
--
>
Bruno Alexandre
Kbenhavn, Danmark
>
"a portuguese in Denmark"
>
>
>
>
Hi Kevin,
but I'm not talking about DLL, only VB files (classes) and having the code
in the same page or separete one.
I dont thing that the IIS will take my hole site and put it in diferent
DLL's (there is an option in framework 2.0 that we can do that into one DLL)
but this is not my point.
--
Bruno Alexandre
Kbenhavn, Danmark
"a portuguese in Denmark"
"Kevin Spencer" <uce@.ftc.govescreveu na mensagem
news:uhr08DH6GHA.3508@.TK2MSFTNGP06.phx.gbl...
Quote:
Originally Posted by
An ASPX file is parsed at run-time to MSIL, which is then compiled to a
native image. A DLL is MSIL, so it takes fewer operations to compile it to
a native image. Of course, caching mechanisms make most of that moot, as
the resources are no continually being re-compiled.
>
--
HTH,
>
Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com
>
If the Truth hurts, wear it.
>
"Bruno Alexandre" <bruno.in.dk@.gmail.comwrote in message
news:uL60f$E6GHA.3508@.TK2MSFTNGP06.phx.gbl...
Quote:
Originally Posted by
>Hi guys,
>>
>What is faster to IIS, a Code Behind file or a In Code aspx file?
>>
>When we call for a Class like dim f as new MyClass if it's a big class,
>will it take longer to run? or the IIS only access the funcions that we
>call inside the class when we call it?
>>
>Thanks
>>
>--
>>
>Bruno Alexandre
>Kbenhavn, Danmark
>>
>"a portuguese in Denmark"
>>
>>
>>
>>
>
>
Perhaps an XML file might do this trick?
each one needs to see a different part of the information. Some supervisors
will all have the same view of the information with the same fields showing.
Others have variations on those fields to see.
The idea is that when an error is made in a certain business process, a log
entry of it would be made. The department responsible would have its
supervisor notified by e-mail. So, in our database, we have a list of all
the departments, but no easy association from the Department to its
supervisor. (Perhaps that's something I'll need to work on)
Anyways, what I want to do is to store an XML file of the department ID's
and the ID of the supervisor to send an e-mail to. Not only that, but I'd
like to use an XML file to control which fields a person needs to see. But
I'm no XML guru by any means. With only 2.5 days to do this, I'm open to
suggestions on how to best implement these requirements.
--
Stephajn CraigThis is a start...
The information I'm "protecting" and at the same time showing is coming out
of a database. The output is a datagrid bound to a datatable. The thought
occurs to me to pass the datatable through an XML transformation (perhaps
using an XSD file?) for whatever user is currently looking at it. And, to
use another XML file for determining the type of transformation to take
place. This way, no changes would have to be made to the underlying code of
the application, but rather to an XML file.
But while I may have a bit of theoretical design in mind,
1. I don't know if it's correct.
2. I don't have any idea how to implement this theory if I AM right.
--
Stephajn Craig
"Marty McDonald" <mcdonama@.wsdot.wa.gov> wrote in message
news:u#G3fIAPDHA.1624@.tk2msftngp13.phx.gbl...
> I'm just learning XML myself. Concerning the information you're trying to
> protect, is it an XML file too? If so, you can use namespace prefixes
> throughout that XML document. Each prefix would represent the kind of
role
> a person requires to view that particular information. From there, you can
> use whatever method you'd like (such as XML transforms?) to get only those
> fields a particular person is allowed to view. I know this might be
vague,
> but maybe someone can elaborate further.
> Marty
> "Stephajn Craig" <s.craig@.NOSPAMfunsunvacations.com> wrote in message
> news:#eMssBAPDHA.3192@.TK2MSFTNGP10.phx.gbl...
> > I've got an application that many supervisors are going to use.
However,
> > each one needs to see a different part of the information. Some
> supervisors
> > will all have the same view of the information with the same fields
> showing.
> > Others have variations on those fields to see.
> > The idea is that when an error is made in a certain business process, a
> log
> > entry of it would be made. The department responsible would have its
> > supervisor notified by e-mail. So, in our database, we have a list of
all
> > the departments, but no easy association from the Department to its
> > supervisor. (Perhaps that's something I'll need to work on)
> > Anyways, what I want to do is to store an XML file of the department
ID's
> > and the ID of the supervisor to send an e-mail to. Not only that, but
I'd
> > like to use an XML file to control which fields a person needs to see.
> But
> > I'm no XML guru by any means. With only 2.5 days to do this, I'm open
to
> > suggestions on how to best implement these requirements.
> > --
> > Stephajn Craig
Permission
I've created my SmartClient that have to print some text directly to the
printer. To do it, I create a text file and after copy it to the printer.
Perfect... But, I am having some permission problems... Look the error:
The application tried to execute a not permited operation by the security
directive ...
System.Drawing.PrintingPermission, System.Drawing.Version=...
Could someone help me?
Thank'sHi,
I think i already send you chris sells article. you can find your
solution there :
http://msdn.microsoft.com/library/d...y/en-us/dnforms
/html/winforms11122002.asp
and
http://msdn.microsoft.com/msdnmag/i...etSmartClients/
HTH
Natty Gur[MVP]
blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!
Permission
I've created my SmartClient that have to print some text directly to the
printer. To do it, I create a text file and after copy it to the printer.
Perfect... But, I am having some permission problems... Look the error:
The application tried to execute a not permited operation by the security
directive ...
System.Drawing.PrintingPermission, System.Drawing.Version=...
Could someone help me?
Thank'sHi,
I think i already send you chris sells article. you can find your
solution there :
http://msdn.microsoft.com/library/d...y/en-us/dnforms
/html/winforms11122002.asp
and
http://msdn.microsoft.com/msdnmag/i...etSmartClients/
HTH
Natty Gur[MVP]
blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Saturday, March 24, 2012
Permission denied
I'm trying to delete a file and getting this:
System.UnauthorizedAccessException: Access to the path "C:/inetpub/wwwroot/appdata/photos/" is denied.
I have identity impersonate="false" and the ASPNET account has full rights for the folder.
The app is running on a remote server.
Any ideas? I'm getting frustrated here.
Thanks,
DavidAre you sure the application pool that your app is running on is using the ASPNET user account to run? Make sure its not the IISWPG user (or any other user for that matter). If your remote box is running Windows 2003, I bet that is the issue..
Thanks Sharbel, if IIS_WPG is a problem, what is the correct configuration for the application pool identity? This is an intranet server on an internal network.
David
Well, it's not that it's 'incorrect', it's just that you might be giving the ASPNET user permission, but it's the IIS_WPG that needs it.
permission denied error message
We have a webservice that can log information to a text file on the local
machine. The ability to log information is configurable. The .net web service
is called from a vb dll. From the vb side of the fence, we're getting an
error message that indicates access is denied to the log file. The folder and
log file both have the asnet user set up with full control. Additionally the
parent folders have list access and read access for the user. The security
event log contains a record with the permissions being requested.
Additional info: the web service works on two other boxes with simular
configurations. The major difference is the box that doesn't work is in the
DMZ and does not have a domain controller.
Any ideas?
KenHi Ken,
In your webservice, do you allow or deny anonymous access?
if you don't deny anonymous access, you might need to
grant permossion to another account IUSR (Ineternet Guest
Account).
HTH
Elton Wang
elton_wang@.hotmail.com
>--Original Message--
>Hi,
>We have a webservice that can log information to a text
file on the local
>machine. The ability to log information is configurable.
The .net web service
>is called from a vb dll. From the vb side of the fence,
we're getting an
>error message that indicates access is denied to the log
file. The folder and
>log file both have the asnet user set up with full
control. Additionally the
>parent folders have list access and read access for the
user. The security
>event log contains a record with the permissions being
requested.
>Additional info: the web service works on two other boxes
with simular
>configurations. The major difference is the box that
doesn't work is in the
>DMZ and does not have a domain controller.
>Any ideas?
>Ken
>.
Permission denied creating directory
I have a created a simple file upload asp.net web page which also creates di
rectories on the fly using the following code:
string fullpath = Server.MapPath(".\\..\\..\\" + path);
DirectoryInfo dir = new DirectoryInfo(fullpath);
if(!dir.Exists)
dir.Create();
Now the dir.Create() statement gives me a permission denied. The ASP.NET use
r has been giving full control to the directory and in IIS Admin the directo
ry has write permissions for scripts set. There is no problem in uploading t
he file to an already creat
ed directory which I find extremely weird!
What goes wrong ?
My OS is Windows XP using .NET framework 1.1. All the latest security patche
s are installed.Hi,
Does the "System" account have access?
Cheers,
Phil Winstanley
Microsoft ASP.NET MVP
http://www.myservicescentral.com
Hi Christoffer:
One way to trouble shoot these types of problems is to enable auditing
and find out "who" is getting the access denied message.
See:
http://www.pluralsight.com/keith/bo...leauditing.html
and
http://www.pluralsight.com/keith/bo...fileaccess.html
Also, make sure the permissions apply to subfolders - click "Advanced"
and check the "Apply To" column.
HTH,
Scott
http://www.OdeToCode.com
On Mon, 21 Jun 2004 08:25:40 -0700, Christoffer Srensen
<ChristofferSrensen@.discussions.microsoft.com> wrote:
>Hi,
>I have a created a simple file upload asp.net web page which also creates d
irectories on the fly using the following code:
>string fullpath = Server.MapPath(".\\..\\..\\" + path);
>DirectoryInfo dir = new DirectoryInfo(fullpath);
>if(!dir.Exists)
> dir.Create();
>Now the dir.Create() statement gives me a permission denied. The ASP.NET user has b
een giving full control to the directory and in IIS Admin the directory has write pe
rmissions for scripts set. There is no problem in uploading the file to an already c
rea
ted directory which I find extremely weird!
>What goes wrong ?
>My OS is Windows XP using .NET framework 1.1. All the latest security patches are i
nstalled.
"Scott Allen" wrote:
> One way to trouble shoot these types of problems is to enable auditing
> and find out "who" is getting the access denied message.
> See:
> http://www.pluralsight.com/keith/bo...leauditing.html
> and
> http://www.pluralsight.com/keith/bo...fileaccess.html
Thanks for these links.
> Also, make sure the permissions apply to subfolders - click "Advanced"
> and check the "Apply To" column.
I have found what the problem was. The ASPNET user I added was from another
domain. Now I have added the local ASPNET user and it works.
The audit thing really helped. Thank you very much!
Kind regards,
Christoffer S?rensen
Permission denied creating directory
I have a created a simple file upload asp.net web page which also creates directories on the fly using the following code:
string fullpath = Server.MapPath(".\\..\\..\\" + path);
DirectoryInfo dir = new DirectoryInfo(fullpath);
if(!dir.Exists)
dir.Create();
Now the dir.Create() statement gives me a permission denied. The ASP.NET user has been giving full control to the directory and in IIS Admin the directory has write permissions for scripts set. There is no problem in uploading the file to an already created directory which I find extremely weird!
What goes wrong ?
My OS is Windows XP using .NET framework 1.1. All the latest security patches are installed.Hi Christoffer:
One way to trouble shoot these types of problems is to enable auditing
and find out "who" is getting the access denied message.
See:
http://www.pluralsight.com/keith/bo...leauditing.html
and
http://www.pluralsight.com/keith/bo...fileaccess.html
Also, make sure the permissions apply to subfolders - click "Advanced"
and check the "Apply To" column.
HTH,
--
Scott
http://www.OdeToCode.com
On Mon, 21 Jun 2004 08:25:40 -0700, Christoffer Srensen
<ChristofferSrensen@.discussions.microsoft.com> wrote:
>Hi,
>I have a created a simple file upload asp.net web page which also creates directories on the fly using the following code:
>string fullpath = Server.MapPath(".\\..\\..\\" + path);
>DirectoryInfo dir = new DirectoryInfo(fullpath);
>if(!dir.Exists)
> dir.Create();
>Now the dir.Create() statement gives me a permission denied. The ASP.NET user has been giving full control to the directory and in IIS Admin the directory has write permissions for scripts set. There is no problem in uploading the file to an already created directory which I find extremely weird!
>What goes wrong ?
>My OS is Windows XP using .NET framework 1.1. All the latest security patches are installed.
"Scott Allen" wrote:
> One way to trouble shoot these types of problems is to enable auditing
> and find out "who" is getting the access denied message.
> See:
> http://www.pluralsight.com/keith/bo...leauditing.html
> and
> http://www.pluralsight.com/keith/bo...fileaccess.html
Thanks for these links.
> Also, make sure the permissions apply to subfolders - click "Advanced"
> and check the "Apply To" column.
I have found what the problem was. The ASPNET user I added was from another domain. Now I have added the local ASPNET user and it works.
The audit thing really helped. Thank you very much!
Kind regards,
Christoffer S?rensen
Permission denied problem. please help me
I am trying to download the file from network machine (under same domain). I
am using below link page code to impersonate.
http://www.netomatix.com/ImpersonateUser.aspx
I can able to impersonate the user, when i try to download the file, its
says "unknown user name and password". I given full permission to domain
user. but the same time when i provied the user name and deails on webconfig
file like below, its allowing me to download.
<identity impersonate="true" userName="mydomain\bala" password="password" /
I dont know where the problem is. Can anyone please give me idea to resolve
this.
I am trying to fix this problem past 3 days.
below is the complete code i am using...
i am getting error on response.writefile. This is the error message
Logon failure: unknown user name or bad password.
exception Details: System.IO.IOException: Logon failure: unknown user name
or bad password.
code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim impContext As WindowsImpersonationContext = Nothing
Try
impContext = NetworkSecurity.ImpersonateUser("mydomain",
"bala", "password", LogonType.LOGON32_LOGON_NETWORK,
LogonProvider.LOGON32_PROVIDER_DEFAULT)
Catch ex As ApplicationException
impContext.Undo()
Response.Write(ex.Message)
End Try
If Not (Nothing Is impContext) Then
Try
Catch ex As Exception
Response.Write(ex.Message)
Finally
impContext.Undo()
If Page.IsPostBack Then
Dim spath As String
spath = "\\laptop02\temp\test.pdf"
'DownloadFile(spath, True)
Dim path1 As String = spath
Dim name As String = Path.GetFileName(path1)
Dim ext As String = Path.GetExtension(path1)
Dim type As String = ""
If Not (ext Is Nothing) Then
Select Case ext.ToLower
Case ".htm", ".html"
type = "text/HTML"
' break
Case ".txt"
type = "text/plain"
' break
Case ".doc", ".rtf"
type = "Application/msword"
' break
Case ".pdf"
type = "Application/pdf"
End Select
End If
'If forceDownload Then
Response.AppendHeader("content-disposition",
"attachment; filename = " & name)
'End If
If Not (type = "") Then
Response.ContentType = type
End If
Response.WriteFile(path1)
Response.End()
End If
End Try
End If
End Sub
thanks
balaImpersonation only allows access to local resources as the user who's using
your site. You want delegation which will allow off-host access as the user
who has authenticated in the browser. In essence it means you need to enable
this in AD for the machine that's running your webserver. Check out this
for more info:
http://pluralsite.com/wiki/default...Delegation.html
-Brock
DevelopMentor
http://staff.develop.com/ballen
> Hi All,
> I am trying to download the file from network machine (under same
> domain). I am using below link page code to impersonate.
> http://www.netomatix.com/ImpersonateUser.aspx
> I can able to impersonate the user, when i try to download the file,
> its says "unknown user name and password". I given full permission to
> domain user. but the same time when i provied the user name and deails
> on webconfig file like below, its allowing me to download.
> <identity impersonate="true" userName="mydomain\bala"
> password="password" />
> I dont know where the problem is. Can anyone please give me idea to
> resolve this. I am trying to fix this problem past 3 days.
> below is the complete code i am using...
> i am getting error on response.writefile. This is the error message
> Logon failure: unknown user name or bad password. exception Details:
> System.IO.IOException: Logon failure: unknown user name or bad
> password.
> code:
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
> Dim impContext As WindowsImpersonationContext = Nothing
> Try
> impContext =
> NetworkSecurity.ImpersonateUser("mydomain",
> "bala", "password", LogonType.LOGON32_LOGON_NETWORK,
> LogonProvider.LOGON32_PROVIDER_DEFAULT)
> Catch ex As ApplicationException
> impContext.Undo()
> Response.Write(ex.Message)
> End Try
> If Not (Nothing Is impContext) Then
> Try
> Catch ex As Exception
> Response.Write(ex.Message)
> Finally
> impContext.Undo()
> If Page.IsPostBack Then
> Dim spath As String
> spath = "\\laptop02\temp\test.pdf"
> 'DownloadFile(spath, True)
> Dim path1 As String = spath
> Dim name As String = Path.GetFileName(path1)
> Dim ext As String = Path.GetExtension(path1)
> Dim type As String = ""
> If Not (ext Is Nothing) Then
> Select Case ext.ToLower
> Case ".htm", ".html"
> type = "text/HTML"
> ' break
> Case ".txt"
> type = "text/plain"
> ' break
> Case ".doc", ".rtf"
> type = "Application/msword"
> ' break
> Case ".pdf"
> type = "Application/pdf"
> End Select
> End If
> 'If forceDownload Then
> Response.AppendHeader("content-disposition",
> "attachment; filename = " & name)
> 'End If
> If Not (type = "") Then
> Response.ContentType = type
> End If
> Response.WriteFile(path1)
> Response.End()
> End If
> End Try
> End If
> End Sub
> thanks
> bala
Hi Brock,
Thanks for the reply. The user name which i am using is under the same
DOMAIN.
Are you mentioning the same domain user or local user for that machine?
Thanks
bala
"Brock Allen" wrote:
> Impersonation only allows access to local resources as the user who's using
> your site. You want delegation which will allow off-host access as the user
> who has authenticated in the browser. In essence it means you need to enable
> this in AD for the machine that's running your webserver. Check out this
> for more info:
> http://pluralsite.com/wiki/default...Delegation.html
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
> > Hi All,
> > I am trying to download the file from network machine (under same
> > domain). I am using below link page code to impersonate.
> > http://www.netomatix.com/ImpersonateUser.aspx
> > I can able to impersonate the user, when i try to download the file,
> > its says "unknown user name and password". I given full permission to
> > domain user. but the same time when i provied the user name and deails
> > on webconfig file like below, its allowing me to download.
> > <identity impersonate="true" userName="mydomain\bala"
> > password="password" />
> > I dont know where the problem is. Can anyone please give me idea to
> > resolve this. I am trying to fix this problem past 3 days.
> > below is the complete code i am using...
> > i am getting error on response.writefile. This is the error message
> > Logon failure: unknown user name or bad password. exception Details:
> > System.IO.IOException: Logon failure: unknown user name or bad
> > password.
> > code:
> > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles Button1.Click
> > Dim impContext As WindowsImpersonationContext = Nothing
> > Try
> > impContext =
> > NetworkSecurity.ImpersonateUser("mydomain",
> > "bala", "password", LogonType.LOGON32_LOGON_NETWORK,
> > LogonProvider.LOGON32_PROVIDER_DEFAULT)
> > Catch ex As ApplicationException
> > impContext.Undo()
> > Response.Write(ex.Message)
> > End Try
> > If Not (Nothing Is impContext) Then
> > Try
> > Catch ex As Exception
> > Response.Write(ex.Message)
> > Finally
> > impContext.Undo()
> > If Page.IsPostBack Then
> > Dim spath As String
> > spath = "\\laptop02\temp\test.pdf"
> > 'DownloadFile(spath, True)
> > Dim path1 As String = spath
> > Dim name As String = Path.GetFileName(path1)
> > Dim ext As String = Path.GetExtension(path1)
> > Dim type As String = ""
> > If Not (ext Is Nothing) Then
> > Select Case ext.ToLower
> > Case ".htm", ".html"
> > type = "text/HTML"
> > ' break
> > Case ".txt"
> > type = "text/plain"
> > ' break
> > Case ".doc", ".rtf"
> > type = "Application/msword"
> > ' break
> > Case ".pdf"
> > type = "Application/pdf"
> > End Select
> > End If
> > 'If forceDownload Then
> > Response.AppendHeader("content-disposition",
> > "attachment; filename = " & name)
> > 'End If
> > If Not (type = "") Then
> > Response.ContentType = type
> > End If
> > Response.WriteFile(path1)
> > Response.End()
> > End If
> > End Try
> > End If
> > End Sub
> > thanks
> > bala
>
>
> Thanks for the reply. The user name which i am using is under the same
> DOMAIN.
Ok, that shouldn't matter with delegation.
> Are you mentioning the same domain user or local user for that
> machine?
For delegation you'll have to be using kerb. The username doesn't matter,
the important thing is to configure the server to be trusted for delegation.
-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi Brock,
Using this below link code i can able to impersonate the user on my domain
user account. From my locl machine IIS i can able to download the other
machine file, like below path.
("AnotherNetworkMachine\temp\ss.pdf")
But when i place this code my server, the impersonate is doing succuss, but
its taking too much time to download and finally it says page cannot be
displayed error.
any idea.
bala
http://west-wind.com/weblog/posts/1572.aspx
"Brock Allen" wrote:
> > Thanks for the reply. The user name which i am using is under the same
> > DOMAIN.
> Ok, that shouldn't matter with delegation.
> > Are you mentioning the same domain user or local user for that
> > machine?
> For delegation you'll have to be using kerb. The username doesn't matter,
> the important thing is to configure the server to be trusted for delegation.
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
Hi Brock,
If i create a local account on webserver and same username and password for
network machine to local, In this point can i able to download the file?
thanks
bala
"Brock Allen" wrote:
> > Thanks for the reply. The user name which i am using is under the same
> > DOMAIN.
> Ok, that shouldn't matter with delegation.
> > Are you mentioning the same domain user or local user for that
> > machine?
> For delegation you'll have to be using kerb. The username doesn't matter,
> the important thing is to configure the server to be trusted for delegation.
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
sorry. when i run the application on same domain its download the file. but
from outside i am getting error. so that wont work.
bala
"Bala" wrote:
> Hi Brock,
> Using this below link code i can able to impersonate the user on my domain
> user account. From my locl machine IIS i can able to download the other
> machine file, like below path.
> ("AnotherNetworkMachine\temp\ss.pdf")
> But when i place this code my server, the impersonate is doing succuss, but
> its taking too much time to download and finally it says page cannot be
> displayed error.
> any idea.
> bala
> http://west-wind.com/weblog/posts/1572.aspx
> "Brock Allen" wrote:
> > > Thanks for the reply. The user name which i am using is under the same
> > > DOMAIN.
> > Ok, that shouldn't matter with delegation.
> > > Are you mentioning the same domain user or local user for that
> > > machine?
> > For delegation you'll have to be using kerb. The username doesn't matter,
> > the important thing is to configure the server to be trusted for delegation.
> > -Brock
> > DevelopMentor
> > http://staff.develop.com/ballen
On Mon, 29 Aug 2005 13:45:32 -0700, "Bala" <Bala@.discussions.microsoft.com> wrote:
Hi Brock,
If i create a local account on webserver and same username and password for
network machine to local, In this point can i able to download the file?
As Brock was indicating, you need to delegate credentials which requires Kerberos if your web
application is configured for Integrated Windows Security.
How to configure an ASP.NET application for a delegation scenario
http://support.microsoft.com/defaul...kb;en-us;810572
Paul
~~~~
Microsoft MVP (Visual Basic)
Permission denied problem. please help me
I am trying to download the file from network machine (under same domain). I
am using below link page code to impersonate.
http://www.netomatix.com/ImpersonateUser.aspx
I can able to impersonate the user, when i try to download the file, its
says "unknown user name and password". I given full permission to domain
user. but the same time when i provied the user name and deails on webconfig
file like below, its allowing me to download.
<identity impersonate="true" userName="mydomain\bala" password="password" />
I dont know where the problem is. Can anyone please give me idea to resolve
this.
I am trying to fix this problem past 3 days.
below is the complete code i am using...
i am getting error on response.writefile. This is the error message
Logon failure: unknown user name or bad password.
exception Details: System.IO.IOException: Logon failure: unknown user name
or bad password.
code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim impContext As WindowsImpersonationContext = Nothing
Try
impContext = NetworkSecurity.ImpersonateUser("mydomain",
"bala", "password", LogonType.LOGON32_LOGON_NETWORK,
LogonProvider.LOGON32_PROVIDER_DEFAULT)
Catch ex As ApplicationException
impContext.Undo()
Response.Write(ex.Message)
End Try
If Not (Nothing Is impContext) Then
Try
Catch ex As Exception
Response.Write(ex.Message)
Finally
impContext.Undo()
If Page.IsPostBack Then
Dim spath As String
spath = "\\laptop02\temp\test.pdf"
'DownloadFile(spath, True)
Dim path1 As String = spath
Dim name As String = Path.GetFileName(path1)
Dim ext As String = Path.GetExtension(path1)
Dim type As String = ""
If Not (ext Is Nothing) Then
Select Case ext.ToLower
Case ".htm", ".html"
type = "text/HTML"
' break
Case ".txt"
type = "text/plain"
' break
Case ".doc", ".rtf"
type = "Application/msword"
' break
Case ".pdf"
type = "Application/pdf"
End Select
End If
'If forceDownload Then
Response.AppendHeader("content-disposition",
"attachment; filename = " & name)
'End If
If Not (type = "") Then
Response.ContentType = type
End If
Response.WriteFile(path1)
Response.End()
End If
End Try
End If
End Sub
thanks
balaImpersonation only allows access to local resources as the user who's using
your site. You want delegation which will allow off-host access as the user
who has authenticated in the browser. In essence it means you need to enable
this in AD for the machine that's running your webserver. Check out this
for more info:
http://pluralsite.com/wiki/default...elop.com/ballen
> Hi All,
> I am trying to download the file from network machine (under same
> domain). I am using below link page code to impersonate.
> http://www.netomatix.com/ImpersonateUser.aspx
> I can able to impersonate the user, when i try to download the file,
> its says "unknown user name and password". I given full permission to
> domain user. but the same time when i provied the user name and deails
> on webconfig file like below, its allowing me to download.
> <identity impersonate="true" userName="mydomain\bala"
> password="password" />
> I dont know where the problem is. Can anyone please give me idea to
> resolve this. I am trying to fix this problem past 3 days.
> below is the complete code i am using...
> i am getting error on response.writefile. This is the error message
> Logon failure: unknown user name or bad password. exception Details:
> System.IO.IOException: Logon failure: unknown user name or bad
> password.
> code:
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
> Dim impContext As WindowsImpersonationContext = Nothing
> Try
> impContext =
> NetworkSecurity.ImpersonateUser("mydomain",
> "bala", "password", LogonType.LOGON32_LOGON_NETWORK,
> LogonProvider.LOGON32_PROVIDER_DEFAULT)
> Catch ex As ApplicationException
> impContext.Undo()
> Response.Write(ex.Message)
> End Try
> If Not (Nothing Is impContext) Then
> Try
> Catch ex As Exception
> Response.Write(ex.Message)
> Finally
> impContext.Undo()
> If Page.IsPostBack Then
> Dim spath As String
> spath = "\\laptop02\temp\test.pdf"
> 'DownloadFile(spath, True)
> Dim path1 As String = spath
> Dim name As String = Path.GetFileName(path1)
> Dim ext As String = Path.GetExtension(path1)
> Dim type As String = ""
> If Not (ext Is Nothing) Then
> Select Case ext.ToLower
> Case ".htm", ".html"
> type = "text/HTML"
> ' break
> Case ".txt"
> type = "text/plain"
> ' break
> Case ".doc", ".rtf"
> type = "Application/msword"
> ' break
> Case ".pdf"
> type = "Application/pdf"
> End Select
> End If
> 'If forceDownload Then
> Response.AppendHeader("content-disposition",
> "attachment; filename = " & name)
> 'End If
> If Not (type = "") Then
> Response.ContentType = type
> End If
> Response.WriteFile(path1)
> Response.End()
> End If
> End Try
> End If
> End Sub
> thanks
> bala
Hi Brock,
Thanks for the reply. The user name which i am using is under the same
DOMAIN.
Are you mentioning the same domain user or local user for that machine?
Thanks
bala
"Brock Allen" wrote:
> Impersonation only allows access to local resources as the user who's usin
g
> your site. You want delegation which will allow off-host access as the use
r
> who has authenticated in the browser. In essence it means you need to enab
le
> this in AD for the machine that's running your webserver. Check out this
> for more info:
> http://pluralsite.com/wiki/default...elop.com/ballen
>
>
>
>
> Thanks for the reply. The user name which i am using is under the same
> DOMAIN.
Ok, that shouldn't matter with delegation.
> Are you mentioning the same domain user or local user for that
> machine?
For delegation you'll have to be using kerb. The username doesn't matter,
the important thing is to configure the server to be trusted for delegation.
-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi Brock,
Using this below link code i can able to impersonate the user on my domain
user account. From my locl machine IIS i can able to download the other
machine file, like below path.
("AnotherNetworkMachine\temp\ss.pdf")
But when i place this code my server, the impersonate is doing succuss, but
its taking too much time to download and finally it says page cannot be
displayed error.
any idea.
bala
http://west-wind.com/weblog/posts/1572.aspx
"Brock Allen" wrote:
> Ok, that shouldn't matter with delegation.
>
> For delegation you'll have to be using kerb. The username doesn't matter,
> the important thing is to configure the server to be trusted for delegatio
n.
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
Hi Brock,
If i create a local account on webserver and same username and password for
network machine to local, In this point can i able to download the file?
thanks
bala
"Brock Allen" wrote:
> Ok, that shouldn't matter with delegation.
>
> For delegation you'll have to be using kerb. The username doesn't matter,
> the important thing is to configure the server to be trusted for delegatio
n.
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
sorry. when i run the application on same domain its download the file. but
from outside i am getting error. so that wont work.
bala
"Bala" wrote:
> Hi Brock,
> Using this below link code i can able to impersonate the user on my domain
> user account. From my locl machine IIS i can able to download the other
> machine file, like below path.
> ("AnotherNetworkMachine\temp\ss.pdf")
> But when i place this code my server, the impersonate is doing succuss, bu
t
> its taking too much time to download and finally it says page cannot be
> displayed error.
> any idea.
> bala
> http://west-wind.com/weblog/posts/1572.aspx
> "Brock Allen" wrote:
>
On Mon, 29 Aug 2005 13:45:32 -0700, "Bala" <Bala@.discussions.microsoft.com>
wrote:
Hi Brock,
If i create a local account on webserver and same username and password fo
r
network machine to local, In this point can i able to download the file?
As Brock was indicating, you need to delegate credentials which requires Ker
beros if your web
application is configured for Integrated Windows Security.
How to configure an ASP.NET application for a delegation scenario
http://support.microsoft.com/defaul...kb;en-us;810572
Paul
~~~~
Microsoft MVP (Visual Basic)
Permission Denied Writing to a file
Help.
buzzWow! I hope this server is not exposed to the Internet in any way.
First, you should use NTFS and not FAT32 (there are no permissions on FAT32 disks).
And making ASPNET an administrator is something you should never do. You could edit the machine.config file instead and make the process use SYSTEM instead of ASPNET. I don't even recommend doing this, and you should really just give enough rights on the directories to ASPNET so that you can write to your file.
Does this help?
I'm just in development on my desktop for now, which is why it's FAT32, and the only reason why I made the ASPNET account an admin was to troubleshoot my permission denied error. That's why I mentioned it, because even with it being an admin I'm still getting this error.
You should use NTFS on your dev machines too. I doubt that you will be able to sort this one out except if you use NTFS. I haven't checked this, but I wouldn't be surprised if we used low permissions by default if the file system is Fat, as there are no permissions on this file system.
And 'low permissions' means no write permission, ever, anywhere? That would be remarkably restrictive, wouldn't it? Aren't there some IIS settings I can look at? I also went into my app in IIS and gave write permission in there and that didn't work either.
Thanks for your input.
buzz
Once again, I'm not sure about that at all.
But usually, a web site has no need to write files.
And it would be incredibly dangerous to allow writing to an unprotected file system by default.
I strongly recommend you use NTFS in all circumstances. Fat32 is only there for Win9x compatibility.
I see, well I'll look into converting to NTFS.
>> But usually, a web site has no need to write files.
Is this true? I'm not an expert, but what about uploading files, etc? Also, I want to write to a file for logging purposes, for when my database goes down.
Thanks for all your help!
buzz
Yes, that's why I said "usually".
Most sites don't need to upload files. And if you upload, you should do so in a directory that's not acessible from the web, for obvious security reasons, whenever possible. And you should always require reliable authentication when you allow for it.
Logging can be done using the System.Diagnostics namespace, using the standard Windows event logs.
Permission Failures with an embedded windows form. What’s the proper way to do this?
I have a windows web form control that opens up a serial port. When I try to embed it an HTML file, I get a securityException when it opens the port. --System.Security.SecurityException: Request for permission of type System.Security.Permissions.SecurityPermission, mscorlib,.......
1) Is there any way I can just tell the browser to trust this object, or just completely trust anything and everything from a certain web site?
2) Right now I had the DLL download from the server when the page loads. It is quite small so speed isn't an issue, I like the concept of downloading it everytime it is used because it will be easier to keep updated. But in terms of permission I was wondering if the proper way may be to install it as a plug in or addon?
The syntax I currently use is :
<object id="SIOControl1"classid="http:SIOControl.dll#SIOControl.SIOTestControl" height="500" width="500" VIEWASTEXT>
You cant programatically "tell" the browser to just trust it, nor can you tell the browser to trust everything from a specific site, not from your application. Imagine the huge security hole that would be. What you CAN do is as the "user" of said site:
Through Internet Options > Sites > Trusted Sites:
Add the address of your website to the trusted sites section. Then set the security of that "zone" to match what you need to accomplish what you're after.
I don't think the solution is as simple as adding it to a trusted site. Just for testing purposes I did that, and set all IE secuirty options and it still dosn't work.
I've tried to add FullTrust to the site with caspol, but to tell you the truth, I just can seem to figure out the proper command.
I've tried: caspol -addgroup LocalIntranet -urlhttp://localhost/SIOControl/* FullTrust
but it tells me that I have an Invalid Label or name, but when I do a caspol -lg I see LocalIntranet there?
permission to File.Exists
In my Web Application, I need to check whether a file exists. I'm using the
System.IO.File.Exists("filename") method.
This file is in another server.
Always the return's method is False. But through the windows explorer I have
permission to access it. So Can I do?
thanks a lot
Marcos SantosMost likely the default ASPNET user account does not have network security
privileges.
To test this theory, use impersonation to have the web application run under
your user account.
Here's more info:
http://msdn.microsoft.com/library/d...personation.asp
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
news:%23$SvPoPSEHA.2408@.tk2msftngp13.phx.gbl...
> Hi,
> In my Web Application, I need to check whether a file exists. I'm using
the
> System.IO.File.Exists("filename") method.
> This file is in another server.
> Always the return's method is False. But through the windows explorer I
have
> permission to access it. So Can I do?
> thanks a lot
> Marcos Santos
>
permission to File.Exists
In my Web Application, I need to check whether a file exists. I'm using the
System.IO.File.Exists("filename") method.
This file is in another server.
Always the return's method is False. But through the windows explorer I have
permission to access it. So Can I do?
thanks a lot
Marcos SantosMost likely the default ASPNET user account does not have network security
privileges.
To test this theory, use impersonation to have the web application run under
your user account.
Here's more info:
http://msdn.microsoft.com/library/d...personation.asp
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Marcos MOS" <marcos.santos@.softway.com.br> wrote in message
news:%23$SvPoPSEHA.2408@.tk2msftngp13.phx.gbl...
> Hi,
> In my Web Application, I need to check whether a file exists. I'm using
the
> System.IO.File.Exists("filename") method.
> This file is in another server.
> Always the return's method is False. But through the windows explorer I
have
> permission to access it. So Can I do?
> thanks a lot
> Marcos Santos
Permission to write a file
I'm coding a Web application which requires to write an XML file into a
folder. I'm wondering other than account Everyone which else I can set
permission so that my application can have the rights to write the file.You have to set permissions on the user that asp.net is working on.
By default it is ASPNET
Regards
Martin
"Hai Nguyen" <haiaggie@.neo.tamu.edu> wrote in message
news:ueILnPGVEHA.1048@.tk2msftngp13.phx.gbl...
> Hi all
> I'm coding a Web application which requires to write an XML file into a
> folder. I'm wondering other than account Everyone which else I can set
> permission so that my application can have the rights to write the file.
>
>
Permission to write a file
I'm coding a Web application which requires to write an XML file into a
folder. I'm wondering other than account Everyone which else I can set
permission so that my application can have the rights to write the file.You have to set permissions on the user that asp.net is working on.
By default it is ASPNET
Regards
Martin
"Hai Nguyen" <haiaggie@.neo.tamu.edu> wrote in message
news:ueILnPGVEHA.1048@.tk2msftngp13.phx.gbl...
> Hi all
> I'm coding a Web application which requires to write an XML file into a
> folder. I'm wondering other than account Everyone which else I can set
> permission so that my application can have the rights to write the file.
>