Click here to Skip to main content
12,402,211 members (72,408 online)
   

ASP.NET

 
QuestionRole based security Pin
vanikanc28-Feb-13 10:51
membervanikanc28-Feb-13 10:51 
AnswerRe: Role based security Pin
Rahul Rajat Singh28-Feb-13 18:05
mvpRahul Rajat Singh28-Feb-13 18:05 
GeneralRe: Role based security Pin
vanikanc4-Mar-13 2:58
membervanikanc4-Mar-13 2:58 
QuestionCreate a basic captcha in C#.net Pin
Member 870181328-Feb-13 4:54
memberMember 870181328-Feb-13 4:54 
AnswerRe: Create a basic captcha in C#.net Pin
Sandeep Mewara28-Feb-13 5:03
mvpSandeep Mewara28-Feb-13 5:03 
GeneralRe: Create a basic captcha in C#.net Pin
Member 870181328-Feb-13 5:13
memberMember 870181328-Feb-13 5:13 
GeneralRe: Create a basic captcha in C#.net Pin
Sandeep Mewara28-Feb-13 5:29
mvpSandeep Mewara28-Feb-13 5:29 
GeneralRe: Create a basic captcha in C#.net Pin
Member 870181328-Feb-13 6:02
memberMember 870181328-Feb-13 6:02 
GeneralRe: Create a basic captcha in C#.net Pin
Sandeep Mewara28-Feb-13 6:23
mvpSandeep Mewara28-Feb-13 6:23 
GeneralRe: Create a basic captcha in C#.net Pin
Member 870181328-Feb-13 6:28
memberMember 870181328-Feb-13 6:28 
GeneralRe: Create a basic captcha in C#.net Pin
Member 870181328-Feb-13 6:24
memberMember 870181328-Feb-13 6:24 
GeneralRe: Create a basic captcha in C#.net Pin
Member 870181328-Feb-13 6:29
memberMember 870181328-Feb-13 6:29 
AnswerRe: Create a basic captcha in C#.net Pin
AshishChaudha28-Feb-13 17:11
memberAshishChaudha28-Feb-13 17:11 
Questionthreaded function to send email, file io crashes Pin
jkirkerx27-Feb-13 8:29
memberjkirkerx27-Feb-13 8:29 
I wrote a function that sends an email on a separate thread in 4.0

I've had trouble with the thread, in getting each one to queue up, but I think I fixed that part.

In the thread, I have a function that reads a HTML file with data fields, and populates the fields with data, I call it my flexible HTML templates. After populating the data, I package the new HTML as the Netmail.Body, to transmit in the message.

So on this message, I send a copy to 3 people, and every once in a while on the 2nd and 3rd copy of the message, it bombs reading the file, because the file is locked or something.

Looking for any ideas on how to fix it.

I'm not sure if I should focus on the file i/o, or on the thread itself, or scrap the idea completely.

Just a general idea of what I'm doing

try
     'Read the Html Template from App_Data, and format the template fields
      htmlStream = New FileStream(m_PhysicalPath, FileMode.Open, FileAccess.Read)
      Dim htmlLen As Long = htmlStream.Length
      Dim fileData As Byte() = New Byte(htmlLen) {}
      htmlStream.Read(fileData, 0, htmlLen)
 
      If Not (htmlStream Is Nothing) Then htmlStream.Close()
 
      Dim byteLine() As Byte = New Byte() {}
      Dim strArray() As String = New String() {}
      For bdx As Integer = 0 To fileData.Length - 1
 
          Dim byteVal As Byte = fileData(bdx)
          If Not (byteVal = &HD) Then
 
              Array.Resize(byteLine, byteLine.Length + 1)
              byteLine(byteLine.Length - 1) = byteVal
 
          Else
              Array.Resize(byteLine, byteLine.Length + 1)
              byteLine(byteLine.Length - 1) = byteVal
 
              Dim charLine() As Char = New Char() {}
              Array.Resize(charLine, byteLine.Length + 1)
 
              For cdx As Integer = 0 To byteLine.Length - 1
                  charLine(cdx) = AsciiByteToChar(byteLine(cdx))
              Next
 
              Dim value As String = New String(charLine)
              Array.Resize(strArray, strArray.Length + 1)
              strArray(strArray.Length - 1) = value
 
              Array.Resize(byteLine, 0)
              bdx += 1
 
          End If
      Next
 
  Catch ex As Exception
 
      m_html_Template = New StringBuilder
      m_html_Template.Append("load_HTML_Template_Checkout_Complete general error")
      dwExitCode = 1
 
  Finally
 
      If Not (htmlStream Is Nothing) Then
          htmlStream.Close()
          htmlStream.Dispose()
          htmlStream = Nothing
      End If
 
  End Try

SuggestionRe: threaded function to send email, file io crashes Pin
Richard Deeming27-Feb-13 9:30
memberRichard Deeming27-Feb-13 9:30 
GeneralRe: threaded function to send email, file io crashes Pin
jkirkerx27-Feb-13 11:28
memberjkirkerx27-Feb-13 11:28 
AnswerRe: file io crashes Pin
David Mujica27-Feb-13 10:40
memberDavid Mujica27-Feb-13 10:40 
QuestionTextArea value in C# Pin
vanikanc27-Feb-13 8:03
membervanikanc27-Feb-13 8:03 
AnswerRe: TextArea value in C# Pin
Sandeep Mewara27-Feb-13 18:12
mvpSandeep Mewara27-Feb-13 18:12 
GeneralRe: TextArea value in C# Pin
Ali Al Omairi(Abu AlHassan)27-Feb-13 20:09
memberAli Al Omairi(Abu AlHassan)27-Feb-13 20:09 
GeneralRe: TextArea value in C# Pin
Sandeep Mewara27-Feb-13 21:02
mvpSandeep Mewara27-Feb-13 21:02 
GeneralRe: TextArea value in C# Pin
Ali Al Omairi(Abu AlHassan)27-Feb-13 22:03
memberAli Al Omairi(Abu AlHassan)27-Feb-13 22:03 
GeneralRe: TextArea value in C# Pin
Sandeep Mewara27-Feb-13 23:16
mvpSandeep Mewara27-Feb-13 23:16 
AnswerRe: TextArea value in C# Pin
Ali Al Omairi(Abu AlHassan)27-Feb-13 20:06
memberAli Al Omairi(Abu AlHassan)27-Feb-13 20:06 
GeneralRe: TextArea value in C# Pin
vanikanc28-Feb-13 2:38
membervanikanc28-Feb-13 2:38 
GeneralRe: TextArea value in C# Pin
Ali Al Omairi(Abu AlHassan)4-Mar-13 4:13
memberAli Al Omairi(Abu AlHassan)4-Mar-13 4:13 
QuestionDataset Issue Pin
Abhismart5527-Feb-13 3:18
memberAbhismart5527-Feb-13 3:18 
AnswerRe: Dataset Issue Pin
Abhismart5527-Feb-13 7:15
memberAbhismart5527-Feb-13 7:15 
QuestionProblems with display image byte() on image tag Pin
keidash27-Feb-13 0:36
memberkeidash27-Feb-13 0:36 
AnswerRe: Problems with display image byte() on image tag Pin
Ali Al Omairi(Abu AlHassan)4-Mar-13 3:26
memberAli Al Omairi(Abu AlHassan)4-Mar-13 3:26 
Questionwhy team is not replyin gmy question Pin
prince_rumeel26-Feb-13 23:13
memberprince_rumeel26-Feb-13 23:13 
AnswerRe: why team is not replyin gmy question Pin
Richard MacCutchan27-Feb-13 1:09
mvpRichard MacCutchan27-Feb-13 1:09 
GeneralRe: why team is not replyin gmy question Pin
prince_rumeel27-Feb-13 20:07
memberprince_rumeel27-Feb-13 20:07 
QuestionSign in with ASP.NET Pin
omarbench26-Feb-13 0:45
memberomarbench26-Feb-13 0:45 
AnswerRe: Sign in with ASP.NET Pin
Sandeep Mewara26-Feb-13 2:16
mvpSandeep Mewara26-Feb-13 2:16 
AnswerRe: Sign in with ASP.NET Pin
ryanb3126-Feb-13 10:34
memberryanb3126-Feb-13 10:34 
AnswerRe: Sign in with ASP.NET Pin
jain jinesh26-Feb-13 19:12
memberjain jinesh26-Feb-13 19:12 
GeneralRe: Sign in with ASP.NET Pin
omarbench26-Feb-13 20:47
memberomarbench26-Feb-13 20:47 
Questionunable to change Web.SiteMap Pin
jojoba201125-Feb-13 23:58
memberjojoba201125-Feb-13 23:58 
AnswerRe: unable to change Web.SiteMap Pin
Sandeep Mewara26-Feb-13 2:24
mvpSandeep Mewara26-Feb-13 2:24 
GeneralRe: unable to change Web.SiteMap Pin
jojoba201126-Feb-13 4:12
memberjojoba201126-Feb-13 4:12 
QuestionBinding gridview from two tables Pin
demoninside925-Feb-13 22:45
memberdemoninside925-Feb-13 22:45 
AnswerRe: Binding gridview from two tables Pin
David Mujica26-Feb-13 5:09
memberDavid Mujica26-Feb-13 5:09 
Questioncustom MVC authorization and Authorize Pin
Super Lloyd25-Feb-13 20:07
memberSuper Lloyd25-Feb-13 20:07 
QuestionMVC Model + Entity Design Guidance Needed. Pin
nlarson1125-Feb-13 11:51
membernlarson1125-Feb-13 11:51 
QuestionDevelop a Custom Login page Pin
Meherab Bhamgara25-Feb-13 3:24
memberMeherab Bhamgara25-Feb-13 3:24 
AnswerRe: Develop a Custom Login page Pin
Sandeep Mewara25-Feb-13 18:13
mvpSandeep Mewara25-Feb-13 18:13 
AnswerRe: Develop a Custom Login page Pin
Rahul Rajat Singh25-Feb-13 20:04
mvpRahul Rajat Singh25-Feb-13 20:04 
Questionproblem with intelligencia.urlrewriter Pin
C#Programmer201224-Feb-13 22:32
memberC#Programmer201224-Feb-13 22:32 
AnswerRe: problem with intelligencia.urlrewriter Pin
C#Programmer201225-Feb-13 17:57
memberC#Programmer201225-Feb-13 17:57 

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.


Advertise | Privacy | Mobile
Web01 | 2.8.160721.1 | Last Updated 27 Jul 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid