{"id":176069,"date":"2013-04-09T22:56:15","date_gmt":"2013-04-09T18:56:15","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=176069"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=176069","title":{"rendered":"<span class=\"post_title\">ASP.NET MVC \u0423\u0440\u043e\u043a 9. Configuration \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<b>\u0426\u0435\u043b\u044c \u0443\u0440\u043e\u043a\u0430.<\/b> \u041d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Web.config. Application section, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0438\u0445 ConfigSection \u0438 IConfig. \u041d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 file-uploader \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u0430, \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0444\u0430\u0439\u043b\u0430. <\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u043e\u043c Web.config. \u042d\u0442\u043e xml-\u0444\u0430\u0439\u043b \u0438 \u0432 \u043d\u0435\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435, \u0438\u0437 \u0447\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b:  <\/p>\n<ul>\n<li><b>configSection<\/b>. \u042d\u0442\u043e \u0441\u0435\u043a\u0446\u0438\u044f \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0442\u043e, \u043a\u0430\u043a\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u043a\u0446\u0438\u0438. \u0421\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 name \u2014 \u044d\u0442\u043e \u0442\u0435\u0433, \u0434\u0430\u043b\u0435\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438, \u0438 type \u2013 \u043a \u043a\u0430\u043a\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f. <\/li>\n<li><b>connectionStrings<\/b>. \u042d\u0442\u043e \u0441\u0435\u043a\u0446\u0438\u044f \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0441\u0442\u0440\u043e\u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n<li><b>appSettings<\/b>. \u0421\u0435\u043a\u0446\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0442\u0438\u043f\u0430 key\/value.<\/li>\n<li><b>system.web, system.webServer<\/b>. \u0421\u0435\u043a\u0446\u0438\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <\/li>\n<li><b>runtime.<\/b> \u0421\u0435\u043a\u0446\u0438\u044f \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 dll.<\/li>\n<li><b>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u043a\u0446\u0438\u0438.<\/b> \u0414\u0440\u0443\u0433\u0438\u0435 \u0441\u0435\u043a\u0446\u0438\u0438 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 configSection.<\/li>\n<\/ul>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<h5>IConfig (\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f).<\/h5>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e Repository, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0438\u0441. \u0421\u043e\u0437\u0434\u0430\u0435\u043c IConfig \u0438 Config-\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432 \u043f\u0430\u043f\u043a\u0435 Global (\/Global\/Config\/IConfig.cs):  <\/p>\n<pre><code class=\"cs\">public interface IConfig     {         string Lang { get; }     } <\/code><\/pre>\n<p>  \u0418   <\/p>\n<pre><code class=\"cs\">public class Config : IConfig     {         public string Lang         {             get              {                 return &quot;ru&quot;;             }         }     } <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 RegisterServices (\/App_Start\/NinjectWebCommon.cs):   <\/p>\n<pre><code class=\"cs\"> kernel.Bind&lt;IConfig&gt;().To&lt;Config&gt;().InSingletonScope(); <\/code><\/pre>\n<p>  \u0418 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0432 BaseController:  <\/p>\n<pre><code class=\"cs\">[Inject] public IConfig Config { get; set; } <\/code><\/pre>\n<p>  \u2003<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0432 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043f\u0435\u0440\u0435\u043e\u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 CultureInfo \u0432 \u043f\u043e\u0442\u043e\u043a\u0435 (\/Controllers\/BaseController.cs):  <\/p>\n<pre><code class=\"cs\">protected override void Initialize(System.Web.Routing.RequestContext requestContext)         {             try             {                 var cultureInfo = new CultureInfo(Config.Lang);                  Thread.CurrentThread.CurrentCulture = cultureInfo;                 Thread.CurrentThread.CurrentUICulture = cultureInfo;             }             catch (Exception ex)             {                 logger.Error(&quot;Culture not found&quot;, ex);             }              base.Initialize(requestContext);         } <\/code><\/pre>\n<p>  \u0418 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u044b\u0432\u043e\u0434 \u0434\u0430\u0442\u044b \u0432 Index.cshtml (\/Areas\/Default\/Views\/Home\/Index.cshtml):  <\/p>\n<pre><code class=\"html\">    @DateTime.Now.ToString(&quot;D&quot;) <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u044b\u0432\u043e\u0434:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/a56\/2de\/3cc\/a562de3cc89afda06cf3f0ab51b8a48f.jpg\"\/><\/p>\n<p>  \u0418 \u043f\u043e-\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u0441\u0432\u044f\u0436\u0435\u043c \u044d\u0442\u043e \u0441 Web.Config. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 Web.config \u0432 appSettings \u0441\u0442\u0440\u043e\u043a\u0443:  <\/p>\n<pre><code class=\"xml\">&lt;add key=&quot;Culture&quot; value=&quot;ru&quot; \/&gt; <\/code><\/pre>\n<p>  \u0412 Config.cs (\/Global\/Config\/Config.cs):  <\/p>\n<pre><code class=\"cs\">public string Lang         {             get              { return ConfigurationManager.AppSettings[&quot;Culture&quot;] as string;               }         } <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u2013 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u043e\u0442 \u0436\u0435, \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 Web.config \u043d\u0430 fr:  <\/p>\n<pre><code class=\"xml\">&lt;add key=&quot;Culture&quot; value=&quot;fr&quot; \/&gt; <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u0442\u0443:  <\/p>\n<pre><code>mardi 5 mars 2013 <\/code><\/pre>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u041c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0435\u0449\u0435 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u044f\u0437\u044b\u043a\u0430\u043c\u0438. \u0421\u043f\u0438\u0441\u043e\u043a \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u0443\u0442 <a href=\"http:\/\/msdn.microsoft.com\/en-us\/goglobal\/bb896001.aspx\"> http:\/\/msdn.microsoft.com\/en-us\/goglobal\/bb896001.aspx<\/a><\/p>\n<h5>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 ConfigSection<\/h5>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0438\u0445 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 ConfigSection. \u0412 \u044d\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u0435 \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0435\u0432\u044c\u044e. \u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c mime-type \u043e\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f, \u0438 \u0438\u043a\u043e\u043d\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 (\u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440):  <\/p>\n<ul>\n<li>\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435<\/li>\n<li>mime-type<\/li>\n<li>\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0438\u043a\u043e\u043d\u043a\u0430<\/li>\n<li>\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f \u0438\u043a\u043e\u043d\u043a\u0430<\/li>\n<\/ul>\n<p>  \u0438 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0432\u044c\u044e:  <\/p>\n<ul>\n<li>\u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0435\u0432\u044c\u044e (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, UserAvatarSize)<\/li>\n<li>\u0448\u0438\u0440\u0438\u043d\u0430<\/li>\n<li>\u0432\u044b\u0441\u043e\u0442\u0430<\/li>\n<\/ul>\n<p>  \u041e\u0431\u0430 \u0442\u0438\u043f\u0430 \u0434\u0435\u043b\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e, \u0442\u0430\u043a \u0447\u0442\u043e \u044f \u0440\u0430\u0441\u043f\u0438\u0448\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043d\u0438\u0445. \u041f\u0443\u0441\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 IconSize, \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0432\u044c\u044e. \u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u2014 \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441, \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u044b\u0439 ConfigurationElement (\/Global\/Config\/IconSize.cs):  <\/p>\n<pre><code class=\"cs\">public class IconSize : ConfigurationElement     {         [ConfigurationProperty(&quot;name&quot;, IsRequired = true, IsKey = true)]         public string Name         {             get             {                 return this[&quot;name&quot;] as string;             }         }          [ConfigurationProperty(&quot;width&quot;, IsRequired = false, DefaultValue = &quot;48&quot;)]         public int Width         {             get             {                 return (int)this[&quot;width&quot;];             }         }          [ConfigurationProperty(&quot;height&quot;, IsRequired = false, DefaultValue = &quot;48&quot;)]         public int Height         {             get             {                 return (int)this[&quot;height&quot;];             }         }     } <\/code><\/pre>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435:  <\/p>\n<ul>\n<li><b>ConfigurationProperty<\/b> \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0438\u043c\u0435\u043d\u0438, \u044d\u0442\u043e \u0438\u043c\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435<\/li>\n<li><b>IsRequired<\/b> \u2013 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0438\u043b\u0438 \u043d\u0435\u0442<\/li>\n<li><b>IsKey<\/b> \u2013 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043a\u043b\u044e\u0447\u043e\u043c (\u043a\u0430\u043a \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0432 \u0411\u0414)<\/li>\n<li><b>DefaultValue<\/b> \u2013 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/li>\n<\/ul>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433 \u2013 \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 (\u0442\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432) \u0438 \u0441\u0435\u043a\u0446\u0438\u0438 (\/Global\/Config\/IconSize.cs):  <\/p>\n<pre><code class=\"cs\"> public class IconSizesConfigSection : ConfigurationSection     {         [ConfigurationProperty(&quot;iconSizes&quot;)]         public IconSizesCollection IconSizes         {             get             {                 return this[&quot;iconSizes&quot;] as IconSizesCollection;             }         }     }      public class IconSizesCollection : ConfigurationElementCollection     {         protected override ConfigurationElement CreateNewElement()         {             return new IconSize();         }          protected override object GetElementKey(ConfigurationElement element)         {             return ((IconSize)element).Name;         } } <\/code><\/pre>\n<p>  \u0412 Web.config \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c:  <\/p>\n<pre><code class=\"xml\">&lt;iconConfig&gt;     &lt;iconSizes&gt;       &lt;add name=&quot;Avatar173Size&quot; width=&quot;173&quot; height=&quot;176&quot; \/&gt; \u2026 &lt;\/iconSizes&gt; &lt;\/iconConfig&gt;  <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0440\u0430\u0437\u0431\u043e\u0440\u0430 \u044d\u0442\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438 \u0432 configSection:  <\/p>\n<pre><code class=\"xml\">      &lt;section name=&quot;iconConfig&quot; type=&quot;LessonProject.Global.Config.IconSizesConfigSection, LessonProject&quot; \/&gt; <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 type \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u043c\u044f dll (<code>LessonProject<\/code>), \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043e \u0432 unit-\u0442\u0435\u0441\u0442\u0430\u0445.<\/p>\n<h5>MailSettings<\/h5>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 smtp-\u043f\u043e\u0447\u0442\u043e\u0439. \u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f:  <\/p>\n<ul>\n<li>SmtpServer. \u0418\u043c\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/li>\n<li>SmtpPort. \u041f\u043e\u0440\u0442, \u043e\u0431\u044b\u0447\u043d\u043e 25\u0439.<\/li>\n<li>SmtpUserName. \u041b\u043e\u0433\u0438\u043d. <\/li>\n<li>SmtpPassword. \u041f\u0430\u0440\u043e\u043b\u044c.<\/li>\n<li>SmtpReply. \u041e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 Reply-to.<\/li>\n<li>SmtpUser. \u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 From.<\/li>\n<li>EnableSsl. \u0414\u0430\/\u043d\u0435\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e Ssl.<\/li>\n<\/ul>\n<p>  \u0424\u0430\u0439\u043b (\/Global\/Config\/MailSetting.cs):  <\/p>\n<pre><code class=\"cs\">public class MailSetting : ConfigurationSection     {         [ConfigurationProperty(&quot;SmtpServer&quot;, IsRequired = true)]         public string SmtpServer         {             get             {                 return this[&quot;SmtpServer&quot;] as string;             }             set             {                 this[&quot;SmtpServer&quot;] = value;             }         }          [ConfigurationProperty(&quot;SmtpPort&quot;, IsRequired = false, DefaultValue=&quot;25&quot;)]         public int SmtpPort         {             get             {                 return (int)this[&quot;SmtpPort&quot;];             }             set             {                 this[&quot;SmtpPort&quot;] = value;             }         }          [ConfigurationProperty(&quot;SmtpUserName&quot;, IsRequired = true)]         public string SmtpUserName         {             get             {                 return this[&quot;SmtpUserName&quot;] as string;             }             set             {                 this[&quot;SmtpUserName&quot;] = value;             }         }          [ConfigurationProperty(&quot;SmtpPassword&quot;, IsRequired = true)]         public string SmtpPassword         {             get             {                 return this[&quot;SmtpPassword&quot;] as string;             }             set             {                 this[&quot;SmtpPassword&quot;] = value;             }         }          [ConfigurationProperty(&quot;SmtpReply&quot;, IsRequired = true)]         public string SmtpReply         {             get             {                 return this[&quot;SmtpReply&quot;] as string;             }             set             {                 this[&quot;SmtpReply&quot;] = value;             }         }          [ConfigurationProperty(&quot;SmtpUser&quot;, IsRequired = true)]         public string SmtpUser         {             get             {                 return this[&quot;SmtpUser&quot;] as string;             }             set             {                 this[&quot;SmtpUser&quot;] = value;             }         }          [ConfigurationProperty(&quot;EnableSsl&quot;, IsRequired = false, DefaultValue=&quot;false&quot;)]         public bool EnableSsl         {             get             {                 return (bool)this[&quot;EnableSsl&quot;];             }             set             {                 this[&quot;EnableSsl&quot;] = value;             }         }     } <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 Web.config:  <\/p>\n<pre><code class=\"xml\">    &lt;section name=&quot;mailConfig&quot; type=&quot;LessonProject.Global.Config.MailSetting, LessonProject&quot; \/&gt; <\/code><\/pre>\n<p>  \u0418  <\/p>\n<pre><code class=\"xml\">  &lt;mailConfig      SmtpServer=&quot;smtp.gmail.com&quot;      SmtpPort=&quot;587&quot;      SmtpUserName=&quot;lxndrpetrov&quot;      SmtpPassword=&quot;**********&quot;      SmtpReply=&quot;lxndrpetrov@gmail.com&quot;      SmtpUser=&quot;test&quot;     EnableSsl=&quot;true&quot; \/&gt;  <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u0441\u0435 \u044d\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0432 IConfig.cs \u0438 \u0421onfig.cs (\/Global\/Config\/IConfig.cs):  <\/p>\n<pre><code class=\"cs\">public interface IConfig     {         string Lang { get; }          IQueryable&lt;IconSize&gt; IconSizes { get; }          IQueryable&lt;MimeType&gt; MimeTypes { get; }          MailSetting MailSetting { get; }     } <\/code><\/pre>\n<p>  \u2003<br \/>  \u0418   <\/p>\n<pre><code class=\"cs\">public IQueryable&lt;IconSize&gt; IconSizes         {             get              {                 IconSizesConfigSection configInfo = (IconSizesConfigSection)ConfigurationManager.GetSection(&quot;iconConfig&quot;);                 return configInfo.IconSizes.OfType&lt;IconSize&gt;().AsQueryable&lt;IconSize&gt;();                               }         }          public IQueryable&lt;MimeType&gt; MimeTypes         {             get             {                 MimeTypesConfigSection configInfo = (MimeTypesConfigSection)ConfigurationManager.GetSection(&quot;mimeConfig&quot;);                 return configInfo.MimeTypes.OfType&lt;MimeType&gt;().AsQueryable&lt;MimeType&gt;();             }         }          public MailSetting MailSetting         {             get              {                  return (MailSetting)ConfigurationManager.GetSection(&quot;mailConfig&quot;);             }         } <\/code><\/pre>\n<p>  \u041c\u044b \u0435\u0449\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c MailTemplates \u2014 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0438 email \u043f\u0440\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438, \u0438\u043b\u0438 \u043f\u0440\u0438 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0438 \u043f\u0430\u0440\u043e\u043b\u044f.<\/p>\n<h5>\u041f\u0440\u043e\u0441\u0442\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432<\/h5>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440, \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c. \u041a\u043b\u0430\u0441\u0441 SimpleFileView \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (\/Models\/Info\/SimpleFileView.cs):  <\/p>\n<pre><code class=\"cs\">public class SimpleFileView     {         public HttpPostedFileBase UploadedFile { get; set; }     } <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u043f\u0440\u0438\u0435\u043c\u0430 \u0444\u0430\u0439\u043b\u043e\u0432. \u0418\u0442\u0430\u043a, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 SimpleFileController (\/Areas\/Default\/Controllers\/SimpleFileController.cs):  <\/p>\n<pre><code class=\"cs\">public class SimpleFileController : DefaultController     {         [HttpGet]         public ActionResult Index()         {             return View(new SimpleFileView());         }          [HttpPost]         public ActionResult Index(SimpleFileView simpleFileView)         {             return View(simpleFileView);         }     } <\/code><\/pre>\n<p>  \u0418 \u0434\u043e\u0431\u0430\u0432\u0438\u043c View:  <\/p>\n<pre><code class=\"html\">@model LessonProject.Models.Info.SimpleFileView @{     ViewBag.Title = &quot;Index&quot;;     Layout = &quot;~\/Areas\/Default\/Views\/Shared\/_Layout.cshtml&quot;; }  &lt;h2&gt;Index&lt;\/h2&gt;  @using (Html.BeginForm(&quot;Index&quot;, &quot;SimpleFile&quot;, FormMethod.Post, new {enctype = &quot;multipart\/form-data&quot;, @class = &quot;form-horizontal&quot; })) {     &lt;fieldset&gt;         &lt;div class=&quot;control-group&quot;&gt;             &lt;label class=&quot;control-label&quot; for=&quot;Email&quot;&gt;                 \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0444\u0430\u0439\u043b:&lt;\/label&gt;             &lt;div class=&quot;controls&quot;&gt;                 @Html.TextBox(&quot;UploadedFile&quot;, Model.UploadedFile, new { type = &quot;file&quot;, @class = &quot;input-xlarge&quot; })                 @Html.ValidationMessage(&quot;UploadedFile&quot;)             &lt;\/div&gt;         &lt;\/div&gt;         &lt;div class=&quot;form-actions&quot;&gt;             &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot;&gt;                 Upload&lt;\/button&gt;         &lt;\/div&gt;     &lt;\/fieldset&gt; } <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043d\u0430 enctype \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445 \u0444\u043e\u0440\u043c\u044b \u0438 \u043d\u0430 type \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445 TextBox (\u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0442\u0438\u043f \u0435\u0449\u0435 \u0431\u044b\u0432\u0430\u0435\u0442 password, checkbox, radio, \u043d\u043e \u0434\u043b\u044f \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0432 @Html-\u043a\u043b\u0430\u0441\u0441\u0435). Enctype \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432 \u201cmultipart\/form-data\u201d, \u0447\u0442\u043e\u0431 \u0431\u044b\u043b\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u044a\u0451\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c. \u041d\u0430\u0448 \u0444\u0430\u0439\u043b \u0431\u043b\u0430\u0433\u043e\u043f\u043e\u043b\u0443\u0447\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d, \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c InputStream \u0432 \u043d\u0435\u043a\u0438\u0439 \u0444\u0430\u0439\u043b. \u041d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u043e\u043a\u0430 \u0442\u0430\u043a \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438. <br \/>  \u2003<br \/>  \u041f\u0435\u0440\u0432\u044b\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u2013 \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u0432\u043e \u0432\u0441\u0435\u0445 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445 \u0444\u043e\u0440\u043c\u0430 \u0432\u044b\u0431\u043e\u0440\u0430 \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/1ee\/248\/43e\/1ee24843e41896d367b5954a7867890d.jpg\"\/><\/p>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u0435\u0434\u044c \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0435\u0431\u0435, \u0447\u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0432 Safari, \u0430 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0432 Chrome \u0438 IE, \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432: \u00ab\u0427\u0442\u043e \u0437\u0430 \u0441\u0430\u043c\u043e\u0434\u0435\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c?\u00bb<br \/>  \u0412\u0442\u043e\u0440\u043e\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u2013\u0435\u0441\u043b\u0438 \u0444\u043e\u0440\u043c\u0430 \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e, \u0442\u043e \u044d\u0442\u0438 \u043f\u043e\u043b\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e. \u0422.\u0435. \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0430\u044f \u0444\u043e\u0440\u043c\u0430:  <\/p>\n<ul>\n<li>\u0418\u043c\u044f<\/li>\n<li>\u0424\u0430\u043c\u0438\u043b\u0438\u044f<\/li>\n<li>\u042d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u0430\u044f \u043f\u043e\u0447\u0442\u0430<\/li>\n<li>\u0414\u0430\u0442\u0430 \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f<\/li>\n<li>\u0424\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f<\/li>\n<li>\u0424\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u043e\u0442\u0430 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430<\/li>\n<li>\u0424\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u043e\u0442\u0430 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430<\/li>\n<li>\u0424\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430 \u0441 \u043f\u0440\u043e\u043f\u0438\u0441\u043a\u043e\u0439<\/li>\n<li>\u041f\u0430\u0440\u043e\u043b\u044c <\/li>\n<li>\u041f\u0430\u0440\u043e\u043b\u044c \u0435\u0449\u0435 \u0440\u0430\u0437<\/li>\n<li>\u041a\u0430\u043f\u0447\u0430<\/li>\n<\/ul>\n<p>  \u0418 \u0432\u0434\u0440\u0443\u0433 \u0432\u044b \u043d\u0430\u0431\u0440\u0430\u043b\u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u043d\u0435\u0432\u0435\u0440\u043d\u043e, \u0438\u043b\u0438 \u043a\u0430\u043f\u0447\u0443 \u043d\u0435 \u0442\u0430\u043a \u0432\u0432\u0435\u043b\u0438, \u0438\u043b\u0438 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u043e\u0442\u0430 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u0438\u043b\u0438 \u0432\u044b \u0437\u0430\u0431\u044b\u043b\u0438 \u043f\u0435\u0440\u0435\u0433\u043d\u0430\u0442\u044c \u0438\u0437 raw-\u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0432 jpeg.<\/p>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438, \u043f\u0440\u043e\u043f\u0438\u0441\u043a\u0443 \u0438 \u043a\u0430\u043f\u0447\u0443 \u043d\u0430\u0434\u043e \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u044d\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 user friendly, \u0438 \u0440\u0430\u0437\u0434\u0440\u0430\u0436\u0430\u0435\u0442 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430 (\u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440 \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043b \u043a\u0440\u0430\u0441\u0438\u0432\u043e, \u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0443\u0431\u043e\u0433\u043e). <\/p>\n<h5>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 (\u043e\u0432) \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Ajax<\/h5>\n<p>  \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0431\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u0430:  <\/p>\n<ul>\n<li>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043a\u043b\u0438\u043a\u0430\u0435\u0442 \u043d\u0430 \u00ab\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u00bb.<\/li>\n<li>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u0430 \u0432\u044b\u0431\u043e\u0440\u0430 \u0444\u0430\u0439\u043b\u0430<\/li>\n<li>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0444\u0430\u0439\u043b<\/li>\n<li>\u0424\u0430\u0439\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f, \u0438\u043b\u0438 \u0432\u044b\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0434\u0430\u0436\u0435 \u0444\u043e\u0440\u043c\u0430 \u0438 \u043d\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e, \u0442\u043e \u0444\u0430\u0439\u043b \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u043c \u0438 \u0435\u0433\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e.<\/li>\n<\/ul>\n<p>  \u042d\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f ajax-\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438 \u0434\u043b\u044f \u043d\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c fineuploader (<a href=\"http:\/\/fineuploader.com\/\">http:\/\/fineuploader.com\/<\/a>). \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043b\u0430\u0442\u043d\u0430\u044f, \u043d\u043e \u043c\u044b \u0441\u043a\u0430\u0447\u0430\u0435\u043c \u0438 \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 (\u0443 \u043d\u0430\u0441 \u0436\u0435 \u0435\u0441\u0442\u044c bundle!). \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435: <a href=\"https:\/\/github.com\/valums\/file-uploader\">https:\/\/github.com\/valums\/file-uploader<\/a>. \u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c js-\u0444\u0430\u0439\u043b\u044b \u0432 \u043f\u0430\u043f\u043a\u0443 \/Scripts\/fine-uploader. Css-\u0444\u0430\u0439\u043b\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c \u0432 \/Content \u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \/Content\/images. \u041f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e url \u0432 fineuploader.css \u0434\u043b\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439:  <\/p>\n<pre><code class=\"css\">.qq-upload-spinner {     display: inline-block;     background: url(&quot;images\/loading.gif&quot;);     width: 15px;     height: 15px;     vertical-align: text-bottom; } .qq-drop-processing {     display: none; } .qq-drop-processing-spinner {     display: inline-block;     background: url(&quot;images\/processing.gif&quot;);     width: 24px;     height: 24px;     vertical-align: text-bottom; } <\/code><\/pre>\n<p>  \u0424\u0430\u0439\u043b\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0432 BundleConfig.cs (\/App_Start\/BundleConfig.cs):  <\/p>\n<pre><code class=\"cs\"> bundles.Add(new ScriptBundle(&quot;~\/bundles\/fineuploader&quot;)                     .Include(&quot;~\/Scripts\/fine-uploader\/header.js&quot;)                     .Include(&quot;~\/Scripts\/fine-uploader\/util.js&quot;)                     .Include(&quot;~\/Scripts\/fine-uploader\/button.js&quot;)                     .Include(&quot;~\/Scripts\/fine-uploader\/ajax.requester.js&quot;)                     .Include(&quot;~\/Scripts\/fine-uploader\/deletefile.ajax.requester.js&quot;)                     .Include(&quot;~\/Scripts\/fine-uploader\/handler.base.js&quot;)                     .Include(&quot;~\/Scripts\/fine-uploader\/window.receive.message.js&quot;)                     .Include(&quot;~\/Scripts\/fine-uploader\/handler.form.js&quot;)                     .Include(&quot;~\/Scripts\/fine-uploader\/handler.xhr.js&quot;)                     .Include(&quot;~\/Scripts\/fine-uploader\/uploader.basic.js&quot;)                     .Include(&quot;~\/Scripts\/fine-uploader\/dnd.js&quot;)                     .Include(&quot;~\/Scripts\/fine-uploader\/uploader.js&quot;)                     .Include(&quot;~\/Scripts\/fine-uploader\/jquery-plugin.js&quot;)                     ); bundles.Add(new StyleBundle(&quot;~\/Content\/css\/fineuploader&quot;)                  .Include(&quot;~\/Content\/fineuploader.css&quot;)); <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 FileController.cs (\/Areas\/Default\/Controllers\/FileController.cs):  <\/p>\n<pre><code class=\"cs\">public class FileController : DefaultController     {         [HttpGet]         public ActionResult Index()         {             return View();         }          public ActionResult Upload(HttpPostedFileWrapper qqfile)         {             return Json(new { result = &quot;ok&quot;, success = true});         }     } <\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434-action Upload \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 qqfile, \u044f \u043d\u0438\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a. \u0410 \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c View \u0434\u043b\u044f Index. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e:  <\/p>\n<ul>\n<li>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443, \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0444\u0430\u0439\u043b.<\/li>\n<li>\u0424\u0430\u0439\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0432\u044c\u044e<\/li>\n<li>\u0424\u0430\u0439\u043b \u0438 \u043f\u0440\u0435\u0432\u044c\u044e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443<\/li>\n<li>\u041c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0443, \u043a\u0443\u0434\u0430 \u0431\u044b\u043b\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u0444\u0430\u0439\u043b \u0438 \u043f\u0440\u0435\u0432\u044c\u044e, \u0447\u0435\u0440\u0435\u0437 Json-\u043e\u0442\u0432\u0435\u0442<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0444\u0430\u0439\u043b\u044b \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c, \u0442\u043e \u0432\u044b\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430<\/li>\n<li>\u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c json-\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u0435\u043c, \u0447\u0442\u043e \u0444\u0430\u0439\u043b \u0438 \u043f\u0440\u0435\u0432\u044c\u044e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e<\/li>\n<li>\u0412\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0444\u043e\u0440\u043c\u044b \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0411\u0414 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b.<\/li>\n<\/ul>\n<p>  View \u0434\u043b\u044f Index:  <\/p>\n<pre><code class=\"html\">@{     ViewBag.Title = &quot;Index&quot;;     Layout = &quot;~\/Areas\/Default\/Views\/Shared\/_Layout.cshtml&quot;; }  @section styles {     @Styles.Render(&quot;~\/Content\/css\/fineuploader&quot;) }  @section scripts {     @Scripts.Render(&quot;~\/bundles\/fineuploader&quot;)     @Scripts.Render(&quot;~\/Scripts\/default\/file-index.js&quot;) }  &lt;h2&gt;Index&lt;\/h2&gt;  &lt;fieldset&gt;     &lt;div class=&quot;control-group&quot;&gt;         &lt;label class=&quot;control-label&quot; for=&quot;Text&quot;&gt;             Image         &lt;\/label&gt;         &lt;div class=&quot;controls&quot;&gt;             &lt;div id=&quot;UploadImage&quot;&gt;                 Upload              &lt;\/div&gt;         &lt;\/div&gt;     &lt;\/div&gt;     &lt;div&gt;         &lt;img src=&quot;&quot; alt=&quot;&quot; id=&quot;ImagePreview&quot; \/&gt;     &lt;\/div&gt; &lt;\/fieldset&gt; <\/code><\/pre>\n<p>  \u041d\u0430\u0448\u0430 \u043a\u043d\u043e\u043f\u043a\u0430 \u0441 id=UploadImage. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c file-index.js \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 (\/Scripts\/default\/file-index.js):  <\/p>\n<pre><code class=\"javascript\">function FileIndex() {     _this = this;      this.ajaxFileUpload = &quot;\/File\/Upload&quot;;      this.init = function () {         $('#UploadImage').fineUploader({             request: {                 endpoint: _this.ajaxFileUpload             },         }).on('error', function (event, id, name, reason) {             \/\/do something         })       .on('complete', function (event, id, name, responseJSON) {           alert(responseJSON);       });     } }  var fileIndex = null;  $().ready(function () {     fileIndex = new FileIndex();     fileIndex.init(); });  <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443:  <\/p>\n<pre><code class=\"javascript\">public ActionResult Upload(HttpPostedFileWrapper qqfile)         {             var extension = Path.GetExtension(qqfile.FileName);             if (!string.IsNullOrWhiteSpace(extension))             {                 var mimeType = Config.MimeTypes.FirstOrDefault(p =&gt; string.Compare(p.Extension, extension, 0) == 0);                  \/\/\u0435\u0441\u043b\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435                 if (mimeType.Name.Contains(&quot;image&quot;))                 {                     \/\/\u0442\u0443\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 \u0444\u0430\u0439\u043b                     var filePath = Path.Combine(&quot;\/Content\/files&quot;, qqfile.FileName);                                          qqfile.SaveAs(Server.MapPath(filePath));                         return Json(new                     {                         success = true,                         result = &quot;error&quot;,                         data = new                         {                             filePath                         }                     });                 }             }             return Json(new { error = &quot;\u041d\u0443\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435&quot;, success = false });         }  <\/code><\/pre>\n<p>  \u0412 Content \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0430\u043f\u043a\u0443 files \u2014 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0430\u043f\u043a\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043a\u043e\u0434:  <\/p>\n<ul>\n<li>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c qqfile (\u0442\u0443\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c, \u044d\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d fineuploader). <\/li>\n<li>\u0418\u0437 \u043d\u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c extension. <\/li>\n<li>\u041f\u043e extension \u043d\u0430\u0445\u043e\u0434\u0438\u043c mimeType. \u0414\u043b\u044f .jpg, .gif, .png \u2013 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c mime-type \u0442\u0438\u043f\u0430 \u00abimage\/\u2026\u00bb. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c. <\/li>\n<li>\u0414\u0430\u043b\u0435\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430, \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u043f\u0430\u043f\u043a\u0435 \/Content\/files (\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043b\u0438) \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Server.MapPath. <\/li>\n<li>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e SaveAs. <\/li>\n<li>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0438\u043c\u044f \u0444\u0430\u0439\u043b \u0432 json data.filePath.<\/li>\n<\/ul>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0432\u0441\u0451 \u043b\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f, \u0438 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043f\u0440\u0435\u0432\u044c\u044e. <\/p>\n<h5>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0435\u0432\u044c\u044e<\/h5>\n<p>  \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0445\u0438\u0442\u0440\u0438\u043b\u0438 \u0441 mime-type = \u00abimage\\&#8230;\u00bb, \u0432\u0435\u0434\u044c \u043a \u043d\u0438\u043c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0438 bmp, \u0438 tiff \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u043c\u0438. <br \/>  \u0422\u0430\u043a \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 PreviewCreator \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 LessonProject.Tools (PreviewCreator.cs):   <\/p>\n<pre><code class=\"cs\">   public static class PreviewCreator     { public static bool SupportMimeType(string mimeType)         {             switch (mimeType)             {                 case &quot;image\/jpg&quot;:                 case &quot;image\/jpeg&quot;:                 case &quot;image\/png&quot;:                 case &quot;image\/gif&quot;:                     return true;             }             return false;         }     } <\/code><\/pre>\n<p>  \u0418 \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u0432 FileController.cs (\/Areas\/Default\/Controller\/FileController.cs):  <\/p>\n<pre><code class=\"cs\">if (mimeType != null && PreviewCreator.SupportMimeType(mimeType.Name)) <\/code><\/pre>\n<p>  \u0412 PreviewCreator \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0432\u044c\u044e, \u0442\u0430\u043a \u0447\u0442\u043e \u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044e \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0437\u0431\u0435\u0440\u0443 \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445. \u0421\u0442\u043e\u0438\u0442 \u0443\u0447\u0435\u0441\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u0435\u0432\u044c\u044e \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 jpeg. \u0418\u0442\u0430\u043a, \u043a\u0430\u043a\u0438\u0435 \u0435\u0441\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b:  <\/p>\n<ul>\n<li>\u0426\u0432\u0435\u0442\u043d\u043e\u0439 \u0438 \u0447\u0435\u0440\u043d\u043e\u0431\u0435\u043b\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c grayscale (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e = false)<\/li>\n<li>\u041f\u0440\u0435\u0432\u044c\u044e. (<code>CreateAndSavePreview<\/code>) \u0415\u0441\u043b\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u043f\u0440\u0435\u0432\u044c\u044e, \u0442\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u0431\u0435\u043b\u043e\u0433\u043e \u0445\u043e\u043b\u0441\u0442\u0430. \u0415\u0441\u043b\u0438 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u043c\u0435\u0435\u0442 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u044c (\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u043a \u0438\u0437 \u043f\u043e\u0440\u0442\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430) \u2013 \u0432\u044b\u0440\u0435\u0437\u0430\u0435\u043c \u0432\u0435\u0440\u0445\u043d\u044e\u044e \u0447\u0430\u0441\u0442\u044c. \u0415\u0441\u043b\u0438 \u0436\u0435 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u0442\u043e \u0432\u044b\u0440\u0435\u0437\u0430\u0435\u043c \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0443.<\/li>\n<li>\u0410\u0432\u0430\u0442\u0430\u0440. (<code>CreateAndSaveAvatar<\/code>) \u0415\u0441\u043b\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u043f\u0440\u0435\u0432\u044c\u044e, \u0442\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f. \u0415\u0441\u043b\u0438 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u043c\u0435\u0435\u0442 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u044c (\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u043a \u0438\u0437 \u043f\u043e\u0440\u0442\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430) \u2013 \u0442\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u043c, \u043f\u043e \u0432\u044b\u0441\u043e\u0442\u0435. \u0415\u0441\u043b\u0438 \u0436\u0435 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u0442\u043e \u0432\u044b\u0440\u0435\u0437\u0430\u0435\u043c \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0443.<\/li>\n<li>\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435. (<code>CreateAndSaveImage<\/code>) \u0415\u0441\u043b\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u044b, \u0442\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0433\u0440\u0430\u043d\u0438\u0446\u044b, \u0442\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u043e \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u043b\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440, \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c.<\/li>\n<li>\u041f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443. (<code>CreateAndSaveFitToSize<\/code>) \u0415\u0441\u043b\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u044b, \u0442\u043e \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0442\u044f\u043d\u0443\u0442\u043e \u0434\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432. \u0421 \u043f\u043e\u0442\u0435\u0440\u0435\u0439 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435.<\/li>\n<li>\u041e\u0431\u0440\u0435\u0437\u0430\u0442\u044c. (<code>CropAndSaveImage<\/code>) \u041a\u0440\u043e\u043c\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0434\u043b\u044f \u043e\u0431\u0440\u0435\u0437\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. <\/li>\n<\/ul>\n<p>  C\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u0435\u0432\u044c\u044e (<code>CreateAndSavePreview<\/code>), \u0432\u0437\u044f\u0432 \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0432\u044c\u044e AvatarSize (\/Areas\/Default\/Controllers\/FileController.cs):  <\/p>\n<pre><code class=\"cs\">var filePreviewPath = Path.Combine(&quot;\/Content\/files\/previews&quot;, qqfile.FileName);                     var previewIconSize = Config.IconSizes.FirstOrDefault(c =&gt; c.Name == &quot;AvatarSize&quot;);                     if (previewIconSize != null)                     {                         PreviewCreator.CreateAndSavePreview(qqfile.InputStream, new Size(previewIconSize.Width, previewIconSize.Height), Server.MapPath(filePreviewPath));                     } return Json(new                     {                         success = true,                         result = &quot;error&quot;,                         data = new                         {                             filePath,                             filePreviewPath                         }                     }); <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c. \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c. \u0424\u0430\u0439\u043b\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f, \u0438 \u0441\u043e\u0437\u0434\u0430\u0441\u0442\u0441\u044f \u043f\u0440\u0435\u0432\u044c\u044e.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0432 file-index.js (\/Scripts\/default\/file-index.js):  <\/p>\n<pre><code class=\"javascript\">$('#UploadImage').fineUploader({             request: {                 endpoint: _this.ajaxFileUpload             },         })         .on('error', function (event, id, name, reason) {             \/\/do something         })         .on('complete', function (event, id, name, responseJSON) {           $(&quot;#ImagePreview&quot;).attr(&quot;src&quot;, responseJSON.data.filePreviewPath);         }); <\/code><\/pre>\n<p>  \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 \u0444\u0430\u0439\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0440\u0435\u0432\u044c\u044e. \u041f\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 hidden \u043f\u043e\u043b\u0435 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0432 \u0411\u0414 \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u0443. <br \/>  \u0427\u0442\u043e \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u0432 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u0442\u0430\u043a \u044d\u0442\u043e \u0434\u0432\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:  <\/p>\n<ul>\n<li>\u0444\u0430\u0439\u043b\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b, \u043d\u043e \u044d\u0442\u043e \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0440\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435, \u0430 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0443 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043e\u043b\u0438<\/li>\n<li>\u0444\u0430\u0439\u043b\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u0438 \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u0411\u0414. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0442\u0435\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0444\u0430\u0439\u043b\u044b \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443, \u0430 \u043f\u043e\u0442\u043e\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043d\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435. <\/li>\n<\/ul>\n<h5>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/h5>\n<p>  \u0415\u0441\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u0430. \u0424\u0430\u0439\u043b \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u0431\u043e\u043b\u0442\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435, \u0430 \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0443\u0442\u044c \u043a \u043d\u0435\u043c\u0443 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 facebook), \u0430 \u043c\u044b \u0443\u0436\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b. <br \/>  \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"cs\">var webClient = new WebClient(); var bytes = webClient.DownloadData(url); var ms = new MemoryStream(bytes); <\/code><\/pre>\n<p>  \u0413\u0434\u0435 url \u2013 \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443. \u041c\u043e\u0436\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c HttpWebRequest:  <\/p>\n<pre><code class=\"cs\">public ActionResult Export(string uri)         {              HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(uri);             webRequest.Method = &quot;GET&quot;;             webRequest.KeepAlive = false;             webRequest.PreAuthenticate = false;             webRequest.Timeout = 1000;             var response = webRequest.GetResponse();              var stream = response.GetResponseStream();             var previewIconSize = Config.IconSizes.FirstOrDefault(c =&gt; c.Name == &quot;AvatarSize&quot;);             var filePreviewPath = Path.Combine(&quot;\/Content\/files\/previews&quot;, Guid.NewGuid().ToString(&quot;N&quot;) + &quot;.jpg&quot;);                                 if (previewIconSize != null)             {                 PreviewCreator.CreateAndSavePreview(stream, new Size(previewIconSize.Width, previewIconSize.Height), Server.MapPath(filePreviewPath));             }              return Content(&quot;OK&quot;);         } <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u0444\u0430\u0439\u043b \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e Guid.NewGuid. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c:  <\/p>\n<pre><code>http:\/\/localhost\/File\/Export?uri=https:\/\/st.free-lance.ru\/users\/chernikov\/upload\/sm_f_81850beffd0d0c89.jpg <\/code><\/pre>\n<p>  \u0424\u0430\u0439\u043b \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0441\u044f \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d. \u0412\u0441\u0451 \u0441\u0443\u043f\u0435\u0440!<\/p>\n<p>  \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u0440\u043e\u0439\u0442\u0438\u0441\u044c \u0434\u0435\u0431\u0430\u0433\u0433\u0435\u0440\u043e\u043c \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 PreviewCreator, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0442\u0430\u043c \u0432\u0441\u0451 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u043e.<\/p>\n<p>  \u0412\u0441\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"https:\/\/bitbucket.org\/chernikov\/lessons\">https:\/\/bitbucket.org\/chernikov\/lessons<\/a>    \t \t\t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/176069\/\"> http:\/\/habrahabr.ru\/post\/176069\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<b>\u0426\u0435\u043b\u044c \u0443\u0440\u043e\u043a\u0430.<\/b> \u041d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Web.config. Application section, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0438\u0445 ConfigSection \u0438 IConfig. \u041d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 file-uploader \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u0430, \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0444\u0430\u0439\u043b\u0430. <\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u043e\u043c Web.config. \u042d\u0442\u043e xml-\u0444\u0430\u0439\u043b \u0438 \u0432 \u043d\u0435\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435, \u0438\u0437 \u0447\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b:  <\/p>\n<ul>\n<li><b>configSection<\/b>. \u042d\u0442\u043e \u0441\u0435\u043a\u0446\u0438\u044f \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0442\u043e, \u043a\u0430\u043a\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u043a\u0446\u0438\u0438. \u0421\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 name \u2014 \u044d\u0442\u043e \u0442\u0435\u0433, \u0434\u0430\u043b\u0435\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438, \u0438 type \u2013 \u043a \u043a\u0430\u043a\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f. <\/li>\n<li><b>connectionStrings<\/b>. \u042d\u0442\u043e \u0441\u0435\u043a\u0446\u0438\u044f \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0441\u0442\u0440\u043e\u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n<li><b>appSettings<\/b>. \u0421\u0435\u043a\u0446\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0442\u0438\u043f\u0430 key\/value.<\/li>\n<li><b>system.web, system.webServer<\/b>. \u0421\u0435\u043a\u0446\u0438\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <\/li>\n<li><b>runtime.<\/b> \u0421\u0435\u043a\u0446\u0438\u044f \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 dll.<\/li>\n<li><b>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u043a\u0446\u0438\u0438.<\/b> \u0414\u0440\u0443\u0433\u0438\u0435 \u0441\u0435\u043a\u0446\u0438\u0438 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 configSection.<\/li>\n<\/ul>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-176069","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/176069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=176069"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/176069\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=176069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=176069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=176069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}