nbsp; return client;
139 }
140
141 client = new WebClient( );
142 client.Headers.Add( "user-agent" , "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2;)" );
143
144 return client;
145
146 }
147 }
148
149 ///
150 /// 判断Uri是否为本地路径
151 /// 152 ///
153 ///
154 private bool IsLocalSource( Uri uri )
155 {
156 for ( int i = localhost.Length ; --i >= 0 ; )
157 {
158 if ( localhost[ i ].ToLower( ) == uri.Host.ToLower( ) )
159 {
160 return true;
161 }
162 }
163
164 return false;
165
166 }
167
168 ///
169 /// 检测文件类型是否为允许下载的文件类型
170 /// 171 ///
扩展名 eg: ".jpg"
172 ///
173 private bool IsAllowedDownloadFile( string extension )
174 {
175 for ( int i = allowImageExtension.Length ; --i >= 0 ; )
176 {
177 if ( allowImageExtension[ i ].ToLower( ) == extension.ToLower( ) )
178 {
179 return true;
180 &n