Click here to Skip to main content
14,356,068 members

.NET Framework

 
QuestionUnable to start program http://localhost:1837/default.aspx using VS 2008 in Windows XP IE 8 Pin
sr15919-Dec-12 0:26
membersr15919-Dec-12 0:26 
SuggestionRe: Unable to start program http://localhost:1837/default.aspx using VS 2008 in Windows XP IE 8 Pin
Richard MacCutchan19-Dec-12 0:52
protectorRichard MacCutchan19-Dec-12 0:52 
QuestionCustomer Hacking System Time Pin
Klockness18-Dec-12 5:33
memberKlockness18-Dec-12 5:33 
AnswerRe: Customer Hacking System Time Pin
Richard MacCutchan18-Dec-12 7:46
protectorRichard MacCutchan18-Dec-12 7:46 
GeneralRe: Customer Hacking System Time Pin
Klockness18-Dec-12 11:25
memberKlockness18-Dec-12 11:25 
AnswerRe: Customer Hacking System Time Pin
Richard Deeming18-Dec-12 8:32
mveRichard Deeming18-Dec-12 8:32 
GeneralRe: Customer Hacking System Time Pin
Klockness18-Dec-12 11:26
memberKlockness18-Dec-12 11:26 
QuestionCan only book for yourself and not other users? Pin
xnaLearner17-Dec-12 2:26
memberxnaLearner17-Dec-12 2:26 
AnswerRe: Can only book for yourself and not other users? Pin
Richard MacCutchan17-Dec-12 4:27
protectorRichard MacCutchan17-Dec-12 4:27 
Questionusing [Authorize] mvc3 Pin
xnaLearner17-Dec-12 2:02
memberxnaLearner17-Dec-12 2:02 
QuestionRe: using [Authorize] mvc3 Pin
Eddy Vluggen17-Dec-12 2:08
mveEddy Vluggen17-Dec-12 2:08 
AnswerRe: using [Authorize] mvc3 Pin
xnaLearner17-Dec-12 2:25
memberxnaLearner17-Dec-12 2:25 
QuestionAdding a flash webcam photo capture Pin
lhsunshine16-Dec-12 20:33
memberlhsunshine16-Dec-12 20:33 
AnswerRe: Adding a flash webcam photo capture Pin
Eddy Vluggen17-Dec-12 1:42
mveEddy Vluggen17-Dec-12 1:42 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine17-Dec-12 2:55
memberlhsunshine17-Dec-12 2:55 
AnswerRe: Adding a flash webcam photo capture Pin
Eddy Vluggen17-Dec-12 3:01
mveEddy Vluggen17-Dec-12 3:01 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine17-Dec-12 3:07
memberlhsunshine17-Dec-12 3:07 
QuestionRe: Adding a flash webcam photo capture Pin
Eddy Vluggen17-Dec-12 3:09
mveEddy Vluggen17-Dec-12 3:09 
AnswerRe: Adding a flash webcam photo capture Pin
lhsunshine17-Dec-12 14:49
memberlhsunshine17-Dec-12 14:49 
AnswerRe: Adding a flash webcam photo capture Pin
Eddy Vluggen18-Dec-12 3:01
mveEddy Vluggen18-Dec-12 3:01 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine18-Dec-12 19:03
memberlhsunshine18-Dec-12 19: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 20:18
memberlhsunshine18-Dec-12 20:18 
GeneralRe: Adding a flash webcam photo capture Pin
Eddy Vluggen18-Dec-12 21:40
mveEddy Vluggen18-Dec-12 21:40 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine19-Dec-12 3:28
memberlhsunshine19-Dec-12 3:28 
QuestionSplitting a url Pin
El Dev14-Dec-12 23:02
memberEl Dev14-Dec-12 23:02 

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.