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

.NET (Core and Framework)

 
AnswerRe: Private byte is being increased continuously without any request Pin
jschell24-Dec-12 7:57
jschell24-Dec-12 7:57 
QuestionMSI not taking/Installing .NET framework Pin
sjs4u19-Dec-12 17:25
sjs4u19-Dec-12 17:25 
AnswerRe: MSI not taking/Installing .NET framework Pin
Dave Kreskowiak19-Dec-12 18:55
mveDave Kreskowiak19-Dec-12 18:55 
QuestionEntity Framework is Updating other column also Pin
indian14319-Dec-12 15:51
indian14319-Dec-12 15:51 
QuestionUnable to start program http://localhost:1837/default.aspx using VS 2008 in Windows XP IE 8 Pin
sr15918-Dec-12 23:26
sr15918-Dec-12 23:26 
SuggestionRe: Unable to start program http://localhost:1837/default.aspx using VS 2008 in Windows XP IE 8 Pin
Richard MacCutchan18-Dec-12 23:52
mveRichard MacCutchan18-Dec-12 23:52 
QuestionCustomer Hacking System Time Pin
Klockness18-Dec-12 4:33
Klockness18-Dec-12 4:33 
AnswerRe: Customer Hacking System Time Pin
Richard MacCutchan18-Dec-12 6:46
mveRichard MacCutchan18-Dec-12 6:46 
GeneralRe: Customer Hacking System Time Pin
Klockness18-Dec-12 10:25
Klockness18-Dec-12 10:25 
AnswerRe: Customer Hacking System Time Pin
Richard Deeming18-Dec-12 7:32
mveRichard Deeming18-Dec-12 7:32 
GeneralRe: Customer Hacking System Time Pin
Klockness18-Dec-12 10:26
Klockness18-Dec-12 10:26 
QuestionCan only book for yourself and not other users? Pin
xnaLearner17-Dec-12 1:26
xnaLearner17-Dec-12 1:26 
AnswerRe: Can only book for yourself and not other users? Pin
Richard MacCutchan17-Dec-12 3:27
mveRichard MacCutchan17-Dec-12 3:27 
Questionusing [Authorize] mvc3 Pin
xnaLearner17-Dec-12 1:02
xnaLearner17-Dec-12 1:02 
QuestionRe: using [Authorize] mvc3 Pin
Eddy Vluggen17-Dec-12 1:08
professionalEddy Vluggen17-Dec-12 1:08 
AnswerRe: using [Authorize] mvc3 Pin
xnaLearner17-Dec-12 1:25
xnaLearner17-Dec-12 1:25 
QuestionAdding a flash webcam photo capture Pin
lhsunshine16-Dec-12 19:33
lhsunshine16-Dec-12 19:33 
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 
Sorry for late reply. This is my code. TQ

C#


Sorry for late reply. This is my code. TQ
C#


using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Collections.Generic;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.Data.SqlClient;
using Pic.User;
using Pic.Action;
using Pic.Common;

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 imgPath = "MemberPicture/" + imgMember;


txtAcc.Text = Session["Cust"].ToString();
lblGeoID.Text = Session["geoID"].ToString();
//lblMNo.Text = Session["memberNo"].ToString();
//lblMName.Text = Session["memberName"].ToString();
lblMember.Text = Session["Member"].ToString();
//string memberID = Convert.ToInt32(txtAcc.Text);
int memberGeoID = Convert.ToInt32(lblGeoID.Text);

CreatePhoto();

action.ExecuteInsert(imgMember, imgPath, txtAcc.Text, memberGeoID,lblMember.Text);


}

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";

//sets the image path
string imgPath = "MemberPicture/" + imgMember;

//then save it to the Folder
FileStream fs = new FileStream(imgPath, FileMode.OpenOrCreate, FileAccess.Write);

BinaryWriter br = new BinaryWriter(fs);
br.Write(photo);
br.Flush();
br.Close();
fs.Close();

}
catch (Exception Ex)
{
throw;
}
}
}
}
//=======================================================================================================
public void ExecuteInsert(string member, string path, string acNo, int memberGeoID, string memberNo)
{
try
{
clsDB db = new clsDB();

clsUser user = new clsUser();


SqlParameter[] sqlParams = {
new SqlParameter("@ImageMember", member),
new SqlParameter("@ImgPath", path),
new SqlParameter("@MID", acNo),
new SqlParameter("@M_GeoID", memberGeoID),
//new SqlParameter("@MNo", MNo),
//new SqlParameter("@MName", MName),
new SqlParameter("@memberNo", memberNo)
};

db.ExecuteStoredProcedure("spAddMemberPic", sqlParams);

}
catch (Exception)
{
throw;
}
}
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 

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.