|
Nopthing . u have to host your site on a particular system . and all other system use this Application by writing url of the pages with that system ipaddress.
suppose u host ur site in 172.0.0.12
then others can use this application by writing http://172.0.0.12/projectname/page.aspx
|
|
|
|
|
Dear Experts,
I want decrypt the string in .Net which is encrypt by the java using AES algorithm. If i use RijndaelManaged
class its showing following error.
Padding is invalid and cannot be removed.
and the i give the .net decrypt code as follows as
private void Decrypt()
{
string strEncrypt = "2f8ae3760636f348e0cb711c5109b78f";// Encrypt string by Java
Rijndael rjin = Rijndael.Create();
rjin.KeySize = 128;
string key = "22tqlER6RPmVvA2omvJJxg=="; // Autokey generated by Java
char[] input = key.ToCharArray();
Base64Decoder decoder = new Base64Decoder(input);
byte[] lByte = decoder.GetDecoded();
rjin.Key = lByte;
rjin.Mode = CipherMode.CBC;
rjin.Padding = PaddingMode.ANSIX923;
ICryptoTransform crypt = rjin.CreateDecryptor();
byte[] cipher = FromHex(strEncrypt);
byte[] plain = crypt.TransformFinalBlock(cipher, 0, cipher.Length); // Here Error showing
Response.Write("Decryped string : " + System.Text.Encoding.UTF8.GetString(plain) + "");
}
Anybody have idea give me
i would be appreciate some help.
Regards
Mani
|
|
|
|
|
Hi there, please help if you can, i am kind of new around so please be patient with me if my question is kind of stupid for you.
I am developing a payroll system that will take the time user is logged in and out subtract them and saves the amount of hours worked in a database table in a column called time_worked. Now these values are stored in the DB as String with the following format (HH:MM:SS).
I want to get these values in an arraylist and add them together.
Right now I am doing the following but it ain't working:
Stored Procedure Used:
@username varchar(50),
@dateStart varchar(50),
@dateFinish varchar(50)
AS
SELECT time_worked
FROM tblTimeWorked
WHERE (user_username = @username) AND (date BETWEEN @dateStart AND @dateFinish)
private void DoTimeWorked()
{
try
{
string start = txtFromDate.Text;
string end = txtToDate.Text;
userService.SupportDS.tblUsersRow rw = (userService.SupportDS.tblUsersRow)userWebservice.GetUsersByUsername(grdUsersPay.SelectedDataKey.Value.ToString()).Rows[0];
string user = rw.user_username;
int hours = 0;
int min = 0;
int sec = 0;
string worked = "";
ArrayList myArrayList = new ArrayList();
DateTime dayViewed = Convert.ToDateTime(start);
foreach (DataRow row in userWebservice.GetHoursWorked(user, start,end).Rows)
{
myArrayList.Add(row);
dayViewed = dayViewed.AddDays(1);
start = dayViewed.ToShortDateString();
}
}
catch (Exception ex)
{
throw ex;
}
}
Question 2: Is there a way how you can make an addition of time? (when minute is 60 adds 1 to hour and resets to 00 minutes etc...)
|
|
|
|
|
Try this . let suppose that u have to time in database
string t1 = "10:00:00" string t2="17:30:50" sometime problem in timespan function so u store time in string
now apply splict function i both strings so that u can find h1 ,h2 , m1,m2 ,c1,c2
now ssolve them ..
in grid in ther is 3 col
ti , te , diff
then use
for (int i =0; i<grid.rows.count;i++)>
{
string t1 = (label)(grid.findcontrl("colname").tostring());
string t2 = (label)(grid.findcontrl("colname").tostring());
string diff = (label)(grid.findcontrl("colname").tostring());
here find find h1 ,h2 , m1,m2 ,c1,c2
}
this is just a logic
|
|
|
|
|
|
keyur_satyadev wrote: i want to make a user control for login page.
You can use ASP.NET inbuilt Login Control.Here[^]
If you want to crate you own, crate a new user control,Add Text box for username and Password. Add login button. Now validate User on login button click.
When Every thing done, place the control in your login page. In Additional you can developed functionality like, remember me, Forgot Password in that control.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
can any one guide me how can i solve this problem...
some times my application with tabpanels works fine and some time i receive this error..
umerumerumer
|
|
|
|
|
please put your script manager to top of the page.
ie. inside the form tag.
this might solve your problem.
Regards
Keyur Satyadev
|
|
|
|
|
hi friends
new programmer in asp.net.now i am using asp.net 2.0.
i am using show some datas from db in textbox.
its work perfectly in client machine.
but in remote server its doesnt work. show some error.
i think connection was established good.
show some error in datareader line =>"Business object cannot be created"
see this code:
OleDbConnection connection = new OleDbConnection();
connection.ConnectionString = "Provider=MS Remote;Remote Server=http://xx.xxx.xxx; Remote Provider=Microsoft.Jet.OLEDB.4.0;Data Source=~/access_db/JDB.mdb;";
System.Data.OleDb.OleDbCommand cmd = new OleDbCommand();
cmd.CommandText = "select * from Login where username='xxx'";
cmd.Connection = connection;
connection.Open();
OleDbDataReader dar = cmd.ExecuteReader(); // error occured tis line ///
if (dar.Read())
{ lbl_status.Text = "Correct";
}
else
{ lbl_status.Text = "Invalid Username";
}
connection.Close();
thx in advance
please give solution for me.....
|
|
|
|
|
take the accessdatasource control instead of oleadb datasource.
keep it inn mind that you are make the connection with access.
so take appropriate control.
Regards
Keyur Satyadev
|
|
|
|
|
Dear Friends,
I am using extjs grid panel ... i am binding the grid panel... Now i want the ith column jth rows value.... Please help me out... I am not able to get the cell value of the grid panel
Please help me out...
Yours
Vinod Gupta
|
|
|
|
|
HI ALL;;;
i want tO Add an asp textbox control to a web page at run time by c# code;;
How Can I Do That?
Thanks all;;;
|
|
|
|
|
you have to make the object of textbox.
it will add automatically in your aspx page.
sample code
Textbox txtName=new TextBox() // object created textbox created
now you can set all the properties of textbox.
in above case
eg. txtName.text="test"
txtName.TabIndex="1" etc.....
Regards
Keyur Satyadev
|
|
|
|
|
I am generating Link Buttons dynamically in a Modal PopUp and on that i provide one handler to do some stuff. But, though it is in an update panel, the page gets refreshed and the Modal PopUp disappears. Please help me in this regard.
|
|
|
|
|
set the mode of update panel to conditional.
so that entire page can not refreshed. that may solve your problem.
Regards
Keyur Satyadev
|
|
|
|
|
Hi all
i stored image path into database and retrive that image path from it and also the picture from there location and display to Grdview control .
iam reffering following link
http://www.codeproject.com/KB/aspnet/GridImage.aspx?msg=2937267#xx2937267xx
Here is my code
int intResult = 0;
string strPath = Server.MapPath(ConfigurationManager.AppSettings["FolderPath"])+"\\"+ FileUpload1.FileName;
SqlConnection con = new SqlConnection("Server=localhost; Database= Employee; uid=sa;pwd=server");
SqlCommand com = new SqlCommand("Insert into ImageStorage(User_Name,Country,Profile_picture)values(@User_Name,@Country,@Profile_picture)", con);
com.Parameters.AddWithValue("@User_Name", TextBox1.Text);
com.Parameters.AddWithValue("@Country", TextBox2.Text);
com.Parameters.AddWithValue("@Profile_picture",strPath);
con.Open();
intResult = Convert.ToInt32(com.ExecuteNonQuery());
if (intResult != 0)
{
FileUpload1.PostedFile.SaveAs(strPath);
Response.Write("Record Inserted.");
}
and in web.config
<appSettings><add key="FolderPath" value="~/images/" /></appSettings>
so sugggest me how i store Path as absolute like ~/Image1.jpg? using above code Path is storing like below
D:\TestingMaterial\images\\button7.jpg
How i store the relative path?
Best Reagrds
Rameez
|
|
|
|
|
Hi i am using a flexgrid . But unable to change the color of single column in it.Which property should i use.
|
|
|
|
|
Hi,
I an getting this error at runtime:
"Object reference not set to an instance of an object."
And the Stack Trace:
"[NullReferenceException: Object reference not set to an instance of an object.]
AjaxControlToolkit.CascadingDropDown.CascadingDropDown_ClientStateValuesLoaded(Object sender, EventArgs e) +98
AjaxControlToolkit.ExtenderControlBase.LoadClientStateValues() +240
AjaxControlToolkit.ExtenderControlBase.Page_PreLoad(Object sender, EventArgs e) +5
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Page.OnPreLoad(EventArgs e) +75
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3368
All help aprreciated,
Thanks
|
|
|
|
|
check you have to create the object first. somewhere u missing the
creating the object. send me the code
Regards
Keyur Satyadev
|
|
|
|
|
how to use email facility in asp.net
|
|
|
|
|
|
Hi ,
You can Reffer following articles for sending emails
http://www.aspsnippets.com/post/2009/02/01/Send-Email-using-CSharp.aspx
http://www.aspsnippets.com/post/2009/01/18/Send-Email-using-VBNet.aspx
Best Regards
|
|
|
|
|
see the code and implement.
SmtpClient sendMail = new SmtpClient();
string mFrom = txtfrom.Text;
string mTo = txtTo.Text;
string mSubject = txtSubject.Text;
string mBody = txtMsg.Text;
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage(mFrom, mTo, mSubject, mBody);
Attachment attach = new Attachment(fileAttach.PostedFile.FileName);
msg.Attachments.Add(attach);
sendMail.Host = "mail.ncodetechnologies.com";
sendMail.Send(msg);
lblMsgSent.Visible = true;
lblMsgSent.Text = "Message Sent";
Regards
Keyur Satyadev
|
|
|
|
|
when i was trying to move from loginpage to some another aspx page like adminindex.aspx page it is redirecting to the same login page. i used response.redirect as well as server.transfer in login button click event of loginpage
modified on Saturday, February 28, 2009 3:26 AM
|
|
|
|
|
aratireddy wrote: when i was trying to move from loginpage to some another page it is redirecting to the same login page i used response.redirect as well as server.transfer in login button click event of loginpage
In which page are your trying to redirect? Can you please put the line of code.
cheers,
Abhijit
CodeProject MVP
|
|
|
|