Олицетворение в ASP.NET MVC

Подавляющее большинство времени, я согласился бы с большей частью мира, что удобочитаемость очень более важна. Компьютеры быстрее, чем можно вообразить и только получение быстрее, компиляторы делают micro-optimzations для Вас, и можно оптимизировать узкие места позже, как только Вы узнаете, где они.

, С другой стороны, тем не менее, иногда, например, если Вы пишете небольшую программу, которая сделает некоторое серьезное перемалывание чисел или другую неинтерактивную, в вычислительном отношении интенсивную задачу, Вам, возможно, придется сделать некоторые высокоуровневые проектные решения с целями производительности в памяти. Если бы необходимо было попытаться оптимизировать медленные части позже в этих случаях, Вы в основном закончили бы тем, что переписали значительные части кода. Например, Вы могли попытаться инкапсулировать вещи хорошо в маленьких классах, и т.д., но если производительность является очень высоким приоритетом, Вам, возможно, придется согласиться на менее хорошо учтенный дизайн, который, например, не работает как много выделений памяти.

23
задан Jason Kemp 10 September 2009 в 14:28
поделиться

1 ответ

Impersonation allows machine to machine impersonation, so the client browser and the server are on the same page when it comes to the impersonation. When you then attempt to access the network share, the computer doesn't trust the impersonated credentials.

You need to enable delegation for the IIS machine in Active Directory. Go to Active Directory Users and Computers, find the computer, click properties, and 'Trust computer for delegation'. (You might need to restart IIS for this to work, I don't remember).

There is way more theory than this that I don't fully understand, but this should work. Whether it is right or not someone else could comment on!

Also, the reason it works on your development machine is that the development server runs as the developer, not (Local)\Network Service.


A decent link:

http://msdn.microsoft.com/en-us/library/cc949004.aspx

What is the difference between impersonation and delegation?

Impersonation flows the original caller’s identity to back-end resources on the same computer. Delegation flows the original caller’s identity to back-end resources on computers other than the computer running the service.

For example, if a service is running within IIS without impersonation, the service will access resources using the ASP.NET account in IIS 5.0, or the Network Service account in IIS 6.0. With impersonation, if the client is connecting using the original caller’s account, the service will access resources such as a SQL Server database on the same machine using the original caller’s account instead of the system ASP.NET account. Delegation is similar except that the SQL Server database could be on a different machine that is remote to the service.

25
ответ дан 29 November 2019 в 02:48
поделиться
Другие вопросы по тегам:

Похожие вопросы: