Click here to Skip to main content
15,896,154 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Adding a flash webcam photo capture Pin
Eddy Vluggen17-Dec-12 0:42
professionalEddy Vluggen17-Dec-12 0:42 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine17-Dec-12 1:55
lhsunshine17-Dec-12 1:55 
AnswerRe: Adding a flash webcam photo capture Pin
Eddy Vluggen17-Dec-12 2:01
professionalEddy Vluggen17-Dec-12 2:01 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine17-Dec-12 2:07
lhsunshine17-Dec-12 2:07 
QuestionRe: Adding a flash webcam photo capture Pin
Eddy Vluggen17-Dec-12 2:09
professionalEddy Vluggen17-Dec-12 2:09 
AnswerRe: Adding a flash webcam photo capture Pin
lhsunshine17-Dec-12 13:49
lhsunshine17-Dec-12 13:49 
AnswerRe: Adding a flash webcam photo capture Pin
Eddy Vluggen18-Dec-12 2:01
professionalEddy Vluggen18-Dec-12 2:01 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine18-Dec-12 18:03
lhsunshine18-Dec-12 18:03 
//I have modified my code to become like this.
//Logfile does not show any error message.
//Still cannot function well in server but can function well in local only.

namespace Pic
{
public partial class ImageConversions : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
clsAction action = new clsAction();

DateTime thisDay = DateTime.Now;
string time = thisDay.ToString("yyyyMMMd HHmmss");
string imgMember = time + ".jpg";
string fName="MemberPicture/";
string imgPath = Path.Combine(fName,imgMember);

try
{
txtAcc.Text = Session["Cust"].ToString();
lblGeoID.Text = Session["geoID"].ToString();
lblMember.Text = Session["Member"].ToString();
int memberGeoID = Convert.ToInt32(lblGeoID.Text);

CreatePhoto();

action.ExecuteInsert(imgMember, imgPath, txtAcc.Text, memberGeoID, lblMember.Text);
lblMsg.Text = "Success";
}
catch (Exception ex)
{
FileInfo txt = new FileInfo("Log.txt");
StreamWriter sw = txt.AppendText();
sw.WriteLine(DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss tt") + " " + "Line No:" + ex.Source + " Message " + ex.Message);
sw.WriteLine(" ");
sw.WriteLine(DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss tt") + " " + ex.StackTrace);
sw.WriteLine(" ");
sw.WriteLine(" ");
sw.Close();
}


}

void CreatePhoto()
{
try
{
string strPhoto = Request.Form["imageData"]; //Get the image from flash file
byte[] photo = Convert.FromBase64String(strPhoto);

DateTime thisDay = DateTime.Now;
string time = thisDay.ToString("yyyyMMMd HHmmss");

//get the file name of the posted image
string imgMember = time + ".jpg";
string fName = "MemberPicture/";
string imgPath = Path.Combine(fName, imgMember);

string fileName = Path.Combine(fName,imgPath);
using (var fs = new FileStream(imgPath, FileMode.OpenOrCreate, FileAccess.Write))
{
// read the file
BinaryWriter br = new BinaryWriter(fs);
br.Write(photo);
br.Flush();
br.Close();
fs.Close();
}
}
catch (Exception ex)
{
FileInfo txt = new FileInfo("Log.txt");
StreamWriter sw = txt.AppendText();
sw.WriteLine(DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss tt") + " " + "Line No:" + ex.Source + " Message " + ex.Message);
sw.WriteLine(" ");
sw.WriteLine(DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss tt") + " " + ex.StackTrace);
sw.WriteLine(" ");
sw.WriteLine(" ");
sw.Close();
}
}
}
}
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine18-Dec-12 19:18
lhsunshine18-Dec-12 19:18 
GeneralRe: Adding a flash webcam photo capture Pin
Eddy Vluggen18-Dec-12 20:40
professionalEddy Vluggen18-Dec-12 20:40 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine19-Dec-12 2:28
lhsunshine19-Dec-12 2:28 
QuestionMessage Removed Pin
16-Dec-12 7:11
watercoldworld16-Dec-12 7:11 
QuestionSplitting a url Pin
El Dev14-Dec-12 22:02
El Dev14-Dec-12 22:02 
Questionpulling across value from list to display in view Pin
xnaLearner14-Dec-12 5:58
xnaLearner14-Dec-12 5:58 
AnswerRe: pulling across value from list to display in view Pin
xnaLearner14-Dec-12 6:49
xnaLearner14-Dec-12 6:49 
AnswerRe: pulling across value from list to display in view Pin
David C# Hobbyist.14-Dec-12 17:41
professionalDavid C# Hobbyist.14-Dec-12 17:41 
GeneralRe: pulling across value from list to display in view Pin
xnaLearner15-Dec-12 8:28
xnaLearner15-Dec-12 8:28 
QuestionMessage Removed Pin
13-Dec-12 5:57
xnaLearner13-Dec-12 5:57 
Questionproblem with relationships Pin
xnaLearner13-Dec-12 2:45
xnaLearner13-Dec-12 2:45 
AnswerRe: problem with relationships Pin
Richard Deeming13-Dec-12 3:48
mveRichard Deeming13-Dec-12 3:48 
GeneralRe: problem with relationships Pin
xnaLearner13-Dec-12 4:37
xnaLearner13-Dec-12 4:37 
Question[VB.NET 2008] DataSet and XML files Pin
steve_949661313-Dec-12 0:06
professionalsteve_949661313-Dec-12 0:06 
AnswerRe: [VB.NET 2008] DataSet and XML files Pin
Eddy Vluggen13-Dec-12 4:28
professionalEddy Vluggen13-Dec-12 4:28 
GeneralRe: [VB.NET 2008] DataSet and XML files Pin
steve_949661313-Dec-12 21:21
professionalsteve_949661313-Dec-12 21:21 
GeneralRe: [VB.NET 2008] DataSet and XML files Pin
Eddy Vluggen14-Dec-12 0:34
professionalEddy Vluggen14-Dec-12 0:34 

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.