Click here to Skip to main content
15,923,006 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Setting Control Focus. Pin
Brij19-Jan-10 19:15
mentorBrij19-Jan-10 19:15 
GeneralRe: Setting Control Focus. Pin
Hema Bairavan19-Jan-10 19:52
Hema Bairavan19-Jan-10 19:52 
GeneralRe: Setting Control Focus. Pin
Brij19-Jan-10 20:15
mentorBrij19-Jan-10 20:15 
QuestionA Design Question Pin
wilsonmanmcp19-Jan-10 9:52
wilsonmanmcp19-Jan-10 9:52 
AnswerRe: A Design Question Pin
Pranay Rana19-Jan-10 17:27
professionalPranay Rana19-Jan-10 17:27 
GeneralRe: A Design Question Pin
wilsonmanmcp19-Jan-10 22:22
wilsonmanmcp19-Jan-10 22:22 
GeneralRe: A Design Question Pin
Pranay Rana19-Jan-10 22:32
professionalPranay Rana19-Jan-10 22:32 
QuestionSlow Processing WebRequest Pin
CJSantora19-Jan-10 2:58
CJSantora19-Jan-10 2:58 
I have written a utility to retrieve images based on entries in a database. All addresses exist but the process is moving extremely slow. When tested through a browser there is no problem. Possibly someone can give me an idea on how to speed the process up. there are a lot of images and they are downloaded each day at approx 4:00 AM. I am posting code below and would like to thank you in advance for your comments and help.

foreach(DataRow dr in Queries.GetInventoryByDealerInventoryID(connstring, dealerinventoryid).Rows)
{

string[] arr = dr["ThirdPartyImageURL"].ToString().Split(new Char[] { ',' });
if (arr.Length != 0)
{
foreach (string s in arr)
{
Console.WriteLine("Getting: " + s);
try
{
if (s.Length != 0)
{
WebRequest request = WebRequest.Create(s);
//WebProxy proxyObj = new WebProxy("**.***.***.**",****); NOT USED ANY LONGER
//request.Credentials = CredentialCache.DefaultCredentials;
//request.Proxy = proxyObj;

WebResponse response = ((WebResponse)(request.GetResponse()));
Stream datastream = response.GetResponseStream();


string[] arrImage = s.Split(new Char[] { '/' });
string tmpImage = arrImage[arrImage.Length - 1];
Console.WriteLine(tmpImage);

/// <remarks>
/// CHANGE THE PATH RETREIVED FROM THE DATABASE TO THE E DRIVE SO IMAGES CAN BE PROPERLY RESIZED AND RENAMED
/// </remarks>
string dealerImagepath = imagepath.ToLower().Replace("f$", "e$");

if (!Directory.Exists(dealerImagepath))
{
/// <remarks>
/// SEND EMAIL NOTIFICATION ABOUT THE BAD DIRECTORY NAME
/// </remarks>

}

int buffersize = 1024;
try
{
FileStream fs = File.Create(dealerImagepath + tmpImage, buffersize, FileOptions.Asynchronous);
byte[] Buffer = new byte[buffersize];
int bytesRead = 0;

while (true)
{
bytesRead = datastream.Read(Buffer, 0, buffersize);
if (bytesRead == 0)
break;

fs.Write(Buffer, 0, bytesRead);
}
fs.Close();
fs.Dispose();
request.Abort();
}
catch (Exception ee)
{
bool bReturnLog = false;
ErrorLog.LogFilePath = "ErrorLogFile.txt";
bReturnLog = ErrorLog.ErrorRoutine(false, ee);
}
}
}
catch(Exception ee)
{
bool bReturnLog = false;
ErrorLog.LogFilePath = "ErrorLogFile.txt";
bReturnLog = ErrorLog.ErrorRoutine(false, ee);
}

}
}
}
AnswerRe: Slow Processing WebRequest Pin
Not Active19-Jan-10 3:42
mentorNot Active19-Jan-10 3:42 
QuestionTo draw over an image and saving the same Pin
KittyKit19-Jan-10 1:55
KittyKit19-Jan-10 1:55 
AnswerRe: To draw over an image and saving the same Pin
Not Active19-Jan-10 3:40
mentorNot Active19-Jan-10 3:40 
GeneralRe: To draw over an image and saving the same Pin
Anurag Gandhi19-Jan-10 18:41
professionalAnurag Gandhi19-Jan-10 18:41 
GeneralRe: To draw over an image and saving the same Pin
KittyKit20-Jan-10 0:00
KittyKit20-Jan-10 0:00 
QuestionExporting Asp.Net page to PDF file Pin
Raheem MA19-Jan-10 0:47
Raheem MA19-Jan-10 0:47 
AnswerRe: Exporting Asp.Net page to PDF file Pin
Anurag Gandhi19-Jan-10 1:13
professionalAnurag Gandhi19-Jan-10 1:13 
GeneralRe: Exporting Asp.Net page to PDF file Pin
Raheem MA19-Jan-10 17:46
Raheem MA19-Jan-10 17:46 
GeneralRe: Exporting Asp.Net page to PDF file Pin
Anurag Gandhi19-Jan-10 19:01
professionalAnurag Gandhi19-Jan-10 19:01 
AnswerRe: Exporting Asp.Net page to PDF file Pin
deepikakhorana19-Jan-10 17:40
deepikakhorana19-Jan-10 17:40 
GeneralRe: Exporting Asp.Net page to PDF file Pin
Raheem MA19-Jan-10 19:51
Raheem MA19-Jan-10 19:51 
GeneralRe: Exporting Asp.Net page to PDF file Pin
deepikakhorana20-Jan-10 21:53
deepikakhorana20-Jan-10 21:53 
AnswerRe: Exporting Asp.Net page to PDF file Pin
Raheem MA20-Jan-10 1:43
Raheem MA20-Jan-10 1:43 
QuestionGridView is Caching does not Update Pin
alaminfad18-Jan-10 23:07
alaminfad18-Jan-10 23:07 
AnswerRe: GridView is Caching does not Update Pin
Nishant Singh19-Jan-10 0:10
Nishant Singh19-Jan-10 0:10 
GeneralRe: GridView is Caching does not Update Pin
alaminfad19-Jan-10 19:46
alaminfad19-Jan-10 19:46 
QuestionDate-Time Format in C# and SQL Server Pin
Zeyad Jalil18-Jan-10 22:48
professionalZeyad Jalil18-Jan-10 22:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.