|
Dear , How can i send an email using SMPT through a proxy ip :
for example : i want to send an email from yahoo to hotmail , but i want to send it
using proxy ip not my ip so when i check the sent message in hotmail i will see the proxy ip
not my ip.i am using this code , but how should i set the proxy ip ?Please any help ...
MailMessage mm = new MailMessage();
mm.From = new MailAddress(txtfrom.Text);
mm.To.Add(new MailAddress("mymail@hotmail.com"));
mm.Subject = "hi" + i.ToString();
mm.Body = "hi" + i.ToString();
mm.IsBodyHtml = false;
SmtpClient sc = new SmtpClient();
sc.Host = "in.smtp.mail.yahoo.com";
sc.Port = 587;
sc.Credentials = new NetworkCredential
(txtuser.Text, txtpass.Text);
//sc.UseDefaultCredentials = true;
//sc.EnableSsl = true;
sc.DeliveryMethod = SmtpDeliveryMethod.Network;
sc.Send(mm);
|
|
|
|
|
Hello, This is Vikash Gohil.
I don't know whether this is the correct forum for my Query.
My Query is I want to print barcodes in Crystal Reports and use the report in ASP.net application.
Using report in ASP.net I have the Idea, but how to print Barcodes in the report.
Is there any in-Built functionality in Crystal Reports for Printing Barcodes or Do I have to use any 3rd party tools.
Please anyone who has done this before or can provide me some idea, would be of great help.
Awaiting for a reply soon.
Thanks in Advance.
|
|
|
|
|
Hi All,
When i compile my page i get erroe as mention below.
" The compiler failed with error code -1073741819 "
Plz can any one help me to overcome this problem
|
|
|
|
|
Dear all,
I want to print blank space between two string like following using
For Each arrStr As String In strSplitArr
If (arrStr <>"") Then
Response.Write(arrStr)
'here i want print with space like following
Response.Write(arrStr+" ")
End If
Next
With response.write how to print blank space.How to use a tab space in response.write?
If any bode help is apreaciable.
kissy
|
|
|
|
|
Try Response.Write(" "); for multiple space repeat the string " " inside Response.Write().
Thanks,
Arindam D Tewary
|
|
|
|
|
Thanks for the reply.It worked for me.
kissy
|
|
|
|
|
Glad to help you
Thanks,
Arindam D Tewary
|
|
|
|
|
i am ceate user registration form
when he enter email like nil@yahoo.com how i can guess this mail valid and
when valid then save in database
|
|
|
|
|
you can apply javascript validation for that or you can apply regular expression validation for that
|
|
|
|
|
THIS IS WRONG QUESTION.......
Pehle dhang se question pooch............
|
|
|
|
|
first see the reply then post your answer, I told answer instead of asking ques.
|
|
|
|
|
Have a look at this
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
itna b nahi pta...ja yar.....
tu to nalayak ka nalayak rha..............
sharam kar kuchh......
|
|
|
|
|
am creating online exam
when user login then give a exam. how can i will give question and it's option for user
when he click next then next question will appear
i am used 3 question type 1.signle for 2 option 2.multiple for 4 or more option and
3.descriptive for single answer
so give me exact answer
|
|
|
|
|
have you tryied it or just asking how to do.what you have done regarding this till yet?
|
|
|
|
|
ive used the same idea once. so this is the code.. try to use it for ur own
C# code
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class CurrentExam : System.Web.UI.Page
{
private int res = 0;
bool[] serialAns;
Exam myE;
protected void Page_Load(object sender, EventArgs e)
{
int num = 1;
this.SmartNavigation = true;
string connectionStr = @"Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + Server.MapPath("DataBase.mdb");
if (IsPostBack==false)
{
this.RdioBtnLst.SelectedIndex = 1;
Session["currentQ"] = 0;
Session["currentQ"] = num;
this.lblNum.Text = num.ToString();
Session["nextQ"] = 0;
myE = new Exam(connectionStr);
serialAns=new bool[this.myE.TotalQ];
for (int j = 0; j < serialAns.Length; j++)
{
serialAns[j] = false;
}
Session["myE"] = myE;
Session["serialAns"] = serialAns;
BindExam(0);
int i = (int)Session["currentQ"];
}
}
protected int calc(bool[] a)
{
int count = 0;
for (int i = 0; i < a.Length; i++)
{
if (a[i]) count++;
}
return count;
}
protected void btnNext_Click(object sender, EventArgs e)
{
this.lblbaqmsg.Text = " ";
myE = (Exam)Session["myE"];
int x = (int)Session["currentQ"] + 1;
if (x > myE.TotalQ-1)
{
x = myE.TotalQ-1;
this.btnNext.Enabled = false;
this.btnCheck.Enabled = false;
}
Session["currentQ"] = x;
this.lblNum.Text = x.ToString();
BindExam(x);
}
protected void btnBaq_Click(object sender, EventArgs e)
{
int x = (int)Session["currentQ"] - 1;
int num = x;
this.lblNum.Text = num.ToString();
if (x < 0)
{
x = 0;
this.lblbaqmsg.Text = "אין אפשרות להשלים את הפעולה";
}
Session["currentQ"] = x;
BindExam(x);
}
protected void BindExam(int i)
{
myE = (Exam)Session["myE"];
this.lblQues.Text = myE.TblExam.Rows[i]["ques"].ToString();
this.lblAns1.Text = myE.TblExam.Rows[i]["ans1"].ToString();
this.lblAns2.Text = myE.TblExam.Rows[i]["ans2"].ToString();
this.lblAns3.Text = myE.TblExam.Rows[i]["ans3"].ToString();
this.lblAns4.Text = myE.TblExam.Rows[i]["ans4"].ToString();
this.lblCorrectAns.Text = myE.TblExam.Rows[i]["correctAns"].ToString();
}
protected void Other1_Load(object sender, EventArgs e)
{
}
protected void btnCheck_Click(object sender, EventArgs e)
{
myE = (Exam)Session["myE"];
int x = (int)Session["currentQ"];
string stCorrect = myE.TblExam.Rows[x]["correctAns"].ToString();
int y = int.Parse(this.RdioBtnLst.SelectedValue);
string stAns="";
if (y==1)
{
stAns = this.myE.TblExam.Rows[x]["ans1"].ToString();
}
else if (y == 2)
{
stAns = this.myE.TblExam.Rows[x]["ans2"].ToString();
}
else if (y == 3)
{
stAns = this.myE.TblExam.Rows[x]["ans3"].ToString();
}
else if (y == 4)
{
stAns = this.myE.TblExam.Rows[x]["ans4"].ToString();
}
if (stCorrect.CompareTo(stAns)==0)
{
this.serialAns = (bool[])Session["serialAns"];
this.serialAns[x] = true;
Session["serialAns"] = this.serialAns;
}
}
protected void btnFinish_Click(object sender, EventArgs e)
{
string connectionStr = @"Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + Server.MapPath("DataBase.mdb");
this.serialAns = (bool[])Session["serialAns"];
int c = this.calc(this.serialAns);
res = (int)Session["c"];
Exam exam = new Exam(connectionStr);
string stuser = (string)Session["username"];
exam.InsertUsersGrades(stuser,res,DateTime.Now);
Session["c"] = c;
Response.Redirect("Result.aspx");
}
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
this is the aspx page
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CurrentExam.aspx.cs" Inherits="CurrentExam" %>
<%@ Register Src="Controls/Other.ascx" TagName="Other" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
</head>
<body bgcolor="#69869B">
<form id="form1" runat="server">
<div>
<table align="right" style="z-index: 108; left: 0px; position: absolute; top: 0px"><tr align="right"><td align="right" style="width: 3px"><asp:Label ID="lblQues" runat="server" align="right" Font-Bold="True" Font-Size="Large"
Font-Underline="True" Style="z-index: 100; left: 224px; position: absolute; top: 440px"
Width="536px"></asp:Label></td></tr>
<tr align="right"><td align="right" style="width: 3px"> <asp:Label ID="lblAns4" runat="server" Style="z-index: 101; left: 320px; position: absolute;
top: 640px" Text="Label" Width="400px" Height="32px"></asp:Label></td></tr>
<tr align="right"><td align="right" style="width: 3px"> <asp:Label ID="lblAns3" runat="server" Style="z-index: 102; left: 320px; position: absolute;
top: 592px" Text="Label" Width="400px" Height="32px"></asp:Label></td></tr>
<tr align="right"><td align="right" style="width: 3px"> <asp:Label ID="lblAns2" runat="server" Style="z-index: 103; left: 320px; position: absolute;
top: 544px" Text="Label" Width="400px" Height="32px"></asp:Label></td></tr>
<tr align="right"><td align="right" style="width: 3px"> <asp:Label ID="lblAns1" runat="server" Font-Bold="False" Style="z-index: 104; left: 320px;
position: absolute; top: 496px" Text="Label" Width="400px" Height="32px"></asp:Label></td></tr>
<tr align="right"><td align="right" style="width: 3px"> <asp:Button ID="btnNext" runat="server" Style="z-index: 105; left: 384px; position: absolute;
top: 768px" Text="<--הבא" Width="56px" OnClick="btnNext_Click" /></td></tr>
<tr align="right"><td align="right" style="width: 3px"> <asp:Button ID="btnBaq" runat="server" Style="z-index: 106; left: 616px; position: absolute;
top: 769px" Text="חזרה-->" OnClick="btnBaq_Click" Width="48px" /></td></tr>
<tr align="right"><td align="right" style="width: 3px"> <asp:Label ID="lblCorrectAns" runat="server" Style="z-index: 108; left: 320px; position: absolute;
top: 696px" Text="Label" Visible="False" Width="400px" Height="32px"></asp:Label></td></tr>
</table>
<asp:RadioButtonList ID="RdioBtnLstans" runat="server" Height="184px" Style="z-index: 100;
left: 744px; position: absolute; top: 488px">
<asp:ListItem Value="1">(1)</asp:ListItem>
<asp:ListItem Value="2">(2)</asp:ListItem>
<asp:ListItem Value="3">(3)</asp:ListItem>
<asp:ListItem Value="4">(4)</asp:ListItem>
</asp:RadioButtonList>
<asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="X-Large" Style="z-index: 101;
left: 480px; position: absolute; top: 384px" Text="...בהצלחה"></asp:Label>
<asp:Button ID="btnCheck" runat="server" OnClick="btnCheck_Click" Style="z-index: 102;
left: 480px; position: absolute; top: 744px" Text="אשר תשובה" />
<asp:Label ID="lblbaqmsg" runat="server" Font-Bold="True" ForeColor="Red" Style="z-index: 103;
left: 704px; position: absolute; top: 800px" Width="184px"></asp:Label>
<asp:Label ID="Label2" runat="server" Height="24px" Style="z-index: 104; left: 792px;
position: absolute; top: 395px" Text="שאלה מספר " Width="80px"></asp:Label>
<asp:Button ID="btnFinish" runat="server" OnClick="btnFinish_Click" Style="left: 376px;
position: relative; top: 776px; z-index: 105;" Text="סיים בחינה" Width="90px" />
<asp:Label ID="lblNum" runat="server" Height="24px" Style="z-index: 109; left: 760px;
position: absolute; top: 392px" Width="16px"></asp:Label>
<uc1:Other
ID="Other1" runat="server" />
<asp:RadioButtonList ID="RdioBtnLst" runat="server" Height="184px" Style="z-index: 107;
left: 768px; position: absolute; top: 488px">
<asp:ListItem Value="1">(1)</asp:ListItem>
<asp:ListItem Value="2">(2)</asp:ListItem>
<asp:ListItem Value="3">(3)</asp:ListItem>
<asp:ListItem Value="4">(4)</asp:ListItem>
</asp:RadioButtonList>
</div>
</form>
</body>
</html>
this is the Exam class in C#
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
public class Exam
{
private string connectionStr;
private int totalQ;
private DataTable tblExam;
private bool result;
public int TotalQ
{
get { return this.totalQ; }
}
public bool Result
{
get { return this.result; }
set { this.result = value; }
}
public DataTable TblExam
{
get {return this.tblExam;}
}
public Exam(string connectionStr)
{
this.totalQ = 30;
this.connectionStr = connectionStr;
string sql = "select ques,ans1,ans2,ans3,ans4,correctAns from questions";
OleDbConnection conn = new OleDbConnection(connectionStr);
OleDbDataAdapter da = new OleDbDataAdapter(sql, conn);
DataSet ds = new DataSet();
da.Fill(ds);
this.tblExam = new DataTable();
DataColumn c1 = new DataColumn("ques");
this.tblExam.Columns.Add(c1);
DataColumn c2 = new DataColumn("ans1");
this.tblExam.Columns.Add(c2);
DataColumn c3 = new DataColumn("ans2");
this.tblExam.Columns.Add(c3);
DataColumn c4 = new DataColumn("ans3");
this.tblExam.Columns.Add(c4);
DataColumn c5 = new DataColumn("ans4");
this.tblExam.Columns.Add(c5);
DataColumn c6 = new DataColumn("correctAns");
this.tblExam.Columns.Add(c6);
for (int i = 0; i < this.totalQ; i++)
{
DataRow row = this.tblExam.NewRow();
row["ques"] = ds.Tables[0].Rows[i]["ques"];
row["ans1"] = ds.Tables[0].Rows[i]["ans1"];
row["ans2"] = ds.Tables[0].Rows[i]["ans2"];
row["ans3"] = ds.Tables[0].Rows[i]["ans3"];
row["ans4"] = ds.Tables[0].Rows[i]["ans4"];
row["correctAns"] = ds.Tables[0].Rows[i]["correctAns"];
this.tblExam.Rows.Add(row);
}
}
public void InsertUsersGrades(string username,int grade,DateTime time)
{
string queryStr="INSERT INTO exams_results values('"+username+"','";
queryStr+=grade+"','";
queryStr+=time+"')";
OleDbConnection connectObj=new OleDbConnection(this.connectionStr);
OleDbCommand myCommandObj=new OleDbCommand(queryStr,connectObj);
connectObj.Open();
myCommandObj.ExecuteNonQuery();
connectObj.Close();
}
public int getAvg(string user)
{
string st;
int sum = 0;
Page p = new Page();
string connectionStr = @"Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + p.Server.MapPath("DataBase.mdb");
string sqlStr = "Select grade FROM memResults WHERE username='" + user + "'";
OleDbDataAdapter daObj = new OleDbDataAdapter(sqlStr, connectionStr);
DataSet dsObj = new DataSet();
daObj.Fill(dsObj);
DataTable dataTable = dsObj.Tables[0];
int count = dsObj.Tables[0].Rows.Count;
foreach (DataRow r in dsObj.Tables[0].Rows)
{
st = r["grade"].ToString();
sum += int.Parse(st);
}
if (sum == null) return -1;
else return sum / count;
}
}
you have to create a table of questions
according to my code it is:
ques
ans1
ans2
ans3
ans4
correctAns
|
|
|
|
|
i am creating online exam
when user login then give a exam. how can i will give question and it's option for user
when he click next then next question will appear
i am used 3 question type 1.signle for 2 option 2.multiple for 4 or more option and
3.descriptive for single answer
so give me exact answer
|
|
|
|
|
I have to use SCORM component in ASP.Net and I don't have any idea about how to use SCORM in ASP.Net. I am beginner for SCORM so I want steps from the very starting. Please help me.
Thanks in advance.
|
|
|
|
|
Hi.
I am new in asp.net and don't know how to assign a calender to text box. for exampl, there is button. I would like when it pressed show the calender and after chosing the right date assign to text box. I really appreciate if some one help me.
thx
|
|
|
|
|
Search google for ajax calender extender control that will helps you.
|
|
|
|
|
you can also search JavaScript calendar from dynamicdrive.com
|
|
|
|
|
thx for ur reply. but I wana use vs 2008 own calender control. I have already read news thoes article regarding ajax, but please tell me how to use the own vs calender control
|
|
|
|
|
because vs calender is a server control a postback is required for this control thats why we use javascript or ajax calanders
|
|
|
|
|
Could u please please explain a little more. thx a lot
|
|
|
|
|