16,018,518 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by haseebsvirgo (Top 30 by date)
haseebsvirgo
26-Jun-11 2:47am
View
lets assume friend word is in an array
haseebsvirgo
26-Jun-11 2:45am
View
i know that but what i want to do is change array element to italics.
e.g
haseeb is my friend.
so change friend word to italics in a sentence.
haseebsvirgo
1-May-11 4:23am
View
how to give input to particular exe file
haseebsvirgo
1-May-11 0:50am
View
i just need some help...
i want to generate flowchart of the code written in a richtextbox on a windows form and display that flowchart to that form in an other pane....
haseebsvirgo
30-Apr-11 1:35am
View
actually i want to ask a question....
my question is that VISUAL STUDIO 2008 provides functionality of generate flowchart of code . Am i be able to access that flowchart in my application like windows form..
haseebsvirgo
29-Apr-11 11:56am
View
oka bro
haseebsvirgo
29-Apr-11 11:40am
View
i know that after so many search then i posted that question
haseebsvirgo
29-Apr-11 11:38am
View
Deleted
also VS2008 provides a built feature for generate flowchart but i cant understand how to use that in win forms
haseebsvirgo
29-Apr-11 11:38am
View
Deleted
i have searched many flowchart generator softwares but i cant understand how to include them in my project...
haseebsvirgo
29-Apr-11 10:55am
View
Deleted
well m not asking for that .....
m asking for how to creat auto flowchart generator in c#
haseebsvirgo
28-Mar-11 7:55am
View
dear by token means the words in a string....
haseebsvirgo
24-Mar-11 11:04am
View
i have done that but when i closed my browser and then again open it i was automatically logged out.
Thats what i dont want to do.
haseebsvirgo
22-Mar-11 16:12pm
View
if any one could solve my prob...
haseebsvirgo
22-Mar-11 16:08pm
View
problem still continues....
haseebsvirgo
22-Mar-11 15:53pm
View
private void ValidateLogin(string emailAddress, string password)
{
try
{
UserInfo objUserInfo = null;
objUserInfo = Gateway.Users.ValidateLogin(emailAddress, password);
if (objUserInfo == null || objUserInfo.UserID == 0)
{
lblError.Text = IEC_Common.Messages.MSG_INVALID_USERNAME_PWD;
trErrorMsg.Visible = true;
return;
}
//if (!IEC_Data_Access.DatabaseUtility.ValidateLogin(emailAddress, password, ref objUserInfo))
//{
// lblError.Text = IEC_Common.Messages.MSG_INVALID_USERNAME_PWD;
// trErrorMsg.Visible = true;
// return;
//}
LoginManager.LogInUser(objUserInfo);
// Create the cookie that contains the forms authentication ticket
HttpCookie authCookie = FormsAuthentication.GetAuthCookie(emailAddress, true);
// Get the FormsAuthenticationTicket out of the encrypted cookie
FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(authCookie.Value);
// Create a new FormsAuthenticationTicket that includes our custom User Data
FormsAuthenticationTicket newTicket = new FormsAuthenticationTicket(ticket.Version, ticket.Name, ticket.IssueDate, ticket.Expiration, ticket.IsPersistent, "");
// Update the authCookie's Value to use the encrypted version of newTicket
authCookie.Value = FormsAuthentication.Encrypt(newTicket);
// Manually add the authCookie to the Cookies collection
Response.Cookies.Add(authCookie);
// Determine redirect URL and send user there
string redirUrl = FormsAuthentication.GetRedirectUrl(emailAddress, chkLogin.Checked);
//if (!redirUrl.Contains("MENU_ID="))
//{
// redirUrl += "?MENU_ID=35";
//}
Response.Redirect(Navigation.GetTamperProofURL(redirUrl));
}
catch (Exception ex)
{
lblError.Text = ex.Message;
}
}
this is my code
haseebsvirgo
22-Mar-11 15:49pm
View
if thats not the accurate method then what can i do except this to keep the user remain looged in ....
haseebsvirgo
11-Mar-11 16:18pm
View
plz help me
haseebsvirgo
10-Dec-10 10:57am
View
actually i want to add
'A' in txtCiphered1
'B' in txtCiphered2
'C' in txtCiphered3.......'Z'intxtCiphered26 on form load so thats why i need a simple loop for that so that in the first iteration txtCiphered1 is selected and filled on 2nd iteration txtCiphered2 is selected and 'B' will be inserted like so on....
haseebsvirgo
10-Dec-10 7:38am
View
sorry u cant understand my question bro
actually i want to fill (A) in txtCiphered1 (B)in txtCiphered2 etc etc...
so i want to do it with a single loop
haseebsvirgo
14-Oct-10 2:16am
View
i basically need a c # code for that many were found but couldnt be help full
haseebsvirgo
16-Aug-10 3:46am
View
From the last 3 days i had goolge on this problem . Try to configure the smtp but in vein.
How to properly configur it please tell me.....
Also tell me whats the fully qualified domain , masquarede domain and smart host in smtp? what to enter in these fields
haseebsvirgo
13-Aug-10 0:56am
View
sir i have tried every thing but still the problem continuous
ok you tell me what type of smtp configuration is required.
is host = 127.0.0.1 ?
port = 25 ?
what rely and access settings would be required?
plz help me sir
haseebsvirgo
12-Aug-10 21:33pm
View
can you please fix my problem
haseebsvirgo
12-Aug-10 21:33pm
View
its a relay
haseebsvirgo
31-Jul-10 5:31am
View
any easy solution except this .....
it will be highly appriciated ....
haseebsvirgo
30-Jul-10 4:22am
View
no
haseebsvirgo
21-Jul-10 13:19pm
View
i want to add it to my project of chat messanger like yahoo messanger provide this functionality
haseebsvirgo
13-Jul-10 1:14am
View
//*BUTTON STOP*//
private void btnStop_Click(object sender, EventArgs e)
{
btnDownload.Enabled = true;
btnPause.Enabled = false;
thrDownload.Abort();
//response.Close();
//reader.Close();
//memStream.Close();
progressBar1.Value = 0;
lbProgress.Text = "0/0";
}
this is the piece of code it all works fine when press download and the thread will start
when i click stop button
thread.abort is executed with a teasing message that thread has been aborted .
i donot want this message to be displayed
i want to display a message that "download cancelled" rather than exception message"THREAD HAS BEEN ABORTED"
PLEASE ITS A HUMBLE REQUEST DO HELP ME ....
haseebsvirgo
13-Jul-10 1:10am
View
//Streams
FtpWebResponse response = request.GetResponse() as FtpWebResponse;
Stream reader = response.GetResponseStream();
//Download to memory
//Note: adjust the streams here to download directly to the hard drive
MemoryStream memStream = new MemoryStream();
byte[] buffer = new byte[1024]; //downloads in chuncks
while (true)
{
Application.DoEvents(); //prevent application from crashing
//Try to read the data
int bytesRead = reader.Read(buffer, 0, buffer.Length);
bytecount++;
if (bytesRead == 0)
{
//Nothing was read, finished downloading
progressBar1.Value = progressBar1.Maximum;
lbProgress.Text = dataLength.ToString() + "/" + dataLength.ToString();
Application.DoEvents();
break;
}
else
{
//Write the downloaded data
memStream.Write(buffer, 0, bytesRead);
//Update the progress bar
if (progressBar1.Value + bytesRead <= progressBar1.Maximum)
{
progressBar1.Value += bytesRead;
lbProgress.Text = progressBar1.Value.ToString() + "/" + dataLength.ToString();
progressBar1.Refresh();
Application.DoEvents();
}
}
}
//Convert the downloaded stream to a byte array
downloadedData = memStream.ToArray();
//Clean up
reader.Close();
memStream.Close();
response.Close();
btnResume.Enabled = false;
btnPause.Enabled = false;
btnStop.Enabled = false;
MessageBox.Show("File Downloaded Successfully");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
txtData.Text = downloadedData.Length.ToString();
this.Text = "Download Data through FTP";
username = string.Empty;
password = string.Empty;
}
haseebsvirgo
13-Jul-10 1:09am
View
//*BUTTON DOWNLOAD*//
private void btnDownload_Click(object sender, EventArgs e)
{
btnDownload.Enabled = false;
btnResume.Enabled = false;
btnPause.Enabled = true;
btnStop.Enabled = true;
if (thrDownload != null && thrDownload.ThreadState == ThreadState.Running)
{
MessageBox.Show("Download in progress!Please wait for download to complete or stop it", "Download In Progress", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
if (DownloadGrid.CurrentRow != null && Convert.ToString(DownloadGrid.CurrentRow.Cells["IPAddress"].Value) != string.Empty)
{
txtServerIP.Text = Convert.ToString(DownloadGrid.CurrentRow.Cells["IPAddress"].Value);
}
if (txtServerIP.Text != "ftp://" && txtServerIP.Text != string.Empty)
if (txtFileName.Text != string.Empty)
{
thrDownload = new Thread(new ThreadStart(delegate { downloadFile(txtServerIP.Text, txtFileName.Text, txtUsername.Text, txtPassword.Text); }));
thrDownload.Start();
saveFile1.FileName = txtFileName.Text;
}
else
MessageBox.Show("Please enter a file name or click the Get File List button");
else
MessageBox.Show("No server found");
}
}
//*FUNCTION DOWNLOAD FILE*//
private byte[] downloadedData;
private void downloadFile(string FTPAddress, string filename, string username, string password)
{
downloadedData = new byte[0];
try
{
//Optional
this.Text = "Connecting...";
Application.DoEvents();
//Create FTP request
// format is ftp://server.com/file.ext
FtpWebRequest request = FtpWebRequest.Create("ftp://" + FTPAddress + "/" + filename) as FtpWebRequest;
//Optional
this.Text = "Retrieving Information...";
Application.DoEvents();
//Get the file size first (for progress bar)
request.Method = WebRequestMethods.Ftp.GetFileSize;
request.Credentials = new NetworkCredential(username, password);
request.UsePassive = true;
request.UseBinary = true;
request.KeepAlive = true; //don't close the connection
int dataLength = (int)request.GetResponse().ContentLength;
//Optional
this.Text = "Downloading File...";
Application.DoEvents();
//Now get the actual data
request = FtpWebRequest.Create("ftp://" + FTPAddress + "/" + filename) as FtpWebRequest;
request.Method = WebRequestMethods.Ftp.DownloadFile;
request.Credentials = new NetworkCredential(username, password);
request.UsePassive = true;
request.UseBinary = true;
request.KeepAlive = false; //close the connection when done
//Set up progress bar
progressBar1.Value = 0;
progressBar1.Maximum = dataLength;
lbProgress.Text = "0/" + dataLength.ToString();
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Show More