Click here to Skip to main content
14,691,559 members
Home » Discussions » .NET (Core and Framework)
   

.NET (Core and Framework)

 
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
professionalEddy 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
professionalEddy 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
professionalEddy Vluggen17-Dec-12 3:09 
AnswerRe: Adding a flash webcam photo capture Pin
lhsunshine17-Dec-12 14:49
Memberlhsunshine17-Dec-12 14:49 
Sorry for late reply. This is my code. TQ


Sorry for late reply. This is my code. TQ

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 3:01
professionalEddy Vluggen18-Dec-12 3:01 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine18-Dec-12 19:03
Memberlhsunshine18-Dec-12 19:03 
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
professionalEddy 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 
Questionpulling across value from list to display in view Pin
xnaLearner14-Dec-12 6:58
MemberxnaLearner14-Dec-12 6:58 
AnswerRe: pulling across value from list to display in view Pin
xnaLearner14-Dec-12 7:49
MemberxnaLearner14-Dec-12 7:49 
AnswerRe: pulling across value from list to display in view Pin
David C# Hobbyist.14-Dec-12 18:41
professionalDavid C# Hobbyist.14-Dec-12 18:41 
GeneralRe: pulling across value from list to display in view Pin
xnaLearner15-Dec-12 9:28
MemberxnaLearner15-Dec-12 9:28 
Questionproblem with relationships Pin
xnaLearner13-Dec-12 3:45
MemberxnaLearner13-Dec-12 3:45 
AnswerRe: problem with relationships Pin
Richard Deeming13-Dec-12 4:48
mveRichard Deeming13-Dec-12 4:48 
GeneralRe: problem with relationships Pin
xnaLearner13-Dec-12 5:37
MemberxnaLearner13-Dec-12 5:37 
Question[VB.NET 2008] DataSet and XML files Pin
steve_949661313-Dec-12 1:06
professionalsteve_949661313-Dec-12 1:06 
AnswerRe: [VB.NET 2008] DataSet and XML files Pin
Eddy Vluggen13-Dec-12 5:28
professionalEddy Vluggen13-Dec-12 5:28 
GeneralRe: [VB.NET 2008] DataSet and XML files Pin
steve_949661313-Dec-12 22:21
professionalsteve_949661313-Dec-12 22:21 
GeneralRe: [VB.NET 2008] DataSet and XML files Pin
Eddy Vluggen14-Dec-12 1:34
professionalEddy Vluggen14-Dec-12 1: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.