Showing posts with label Web. Show all posts
Showing posts with label Web. Show all posts

Wednesday, 13 June 2012

copy Outlook Calendar items from one folder to another

For Outlook 2010


Clearing the filter from an existing view


To clear the filter from an existing tabular view, follow these steps:

  1. Click to select the Outlook Calendar folder.

  2. On the View tab, click Change view, and then click to select one of the tabular views such as By List or ByCategory.

  3. On the View menu, click Reset View.

  4. Click Yes to reset the view to the original settings.


Defining a new tabular view


To define a new permanent tabular view, follow these steps:

  1. Click to select the Calendar folder.

  2. On the View tab, click Change view, click Manage Views, and then click New.

  3. Type a name for the new view, click to select Table, and then click OK.

  4. In Advanced View Settings, click Sort.

  5. In the Sort items by list, click to select Start and Ascending.

  6. In the Then By list, click to select (none), and then click OK.

  7. Click OK, and then click Apply View.


Either of the previous procedures will display a list of all Calendar items.

After all items are displayed, follow these steps:

  1. To select all items, use the keyboard shortcut, CONTROL+A.

  2. To copy the items, use the keyboard shortcut, CONTROL+C.

  3. Click to select the destination folder.
    Note To paste the items correctly, the destination folder must be a calendar folder.

  4. To paste the items, use the keyboard shortcut, CONTROL+V.


This process inserts a copy of all the Calendar items into the destination folder.

Additional option for Outlook 2010



  1. On the Folder tab, click Copy Calendar.

  2. Select the folder location where you want the calendar to be saved, and then click OK.


NoteTo copy the items correctly, the destination folder must be a calendar folder.

For Outlook 2007, 2003, 2002, 2000


Clearing the filter from an existing view


To clear the filter from an existing tabular view, follow these steps:

  1. Click to select the Outlook Calendar folder.

  2. On the View menu, point to Current View, and then click to select one of the tabular views such as Events or By Category.

  3. On the View menu, point to Current View, and then click Customize Current View.

  4. In the View Summary dialog box, click Filter, click Clear All, and then click OK twice.


Defining a new tabular view


To define a new permanent, tabular view, follow these steps:

  1. Click to select the Calendar folder.

  2. On the View menu, point to Current View, click Define Views, and then click New.

  3. Type a name for the new view, click to select Table, and then click OK.

  4. In View Summary, click Sort.

  5. In the Sort items by list, click to select Start and Ascending.

  6. In the Then By list, click to select (none), and then click OK.

  7. Click OK, and then click Apply View.


Either one of the previous procedures will display a list of all Calendar items.

After all items are displayed, follow these steps:

  1. On the Edit menu, click Select All.

  2. On the Edit menu, click Copy.

  3. Click to select the destination folder.

  4. On the Edit menu, click Paste.


This process inserts a copy of all the Calendar items into the destination folder.

Monday, 11 June 2012

Import Excel Sheet to SharePoint List



In this article, we will learn how to export the excel data to the SharePoint list.
Steps:

1. Click on Site Actions -> More Options


2. Now click on the Lists -> Select Import Spread Sheet from the type -> then Click Create


3. Give the Name and Description of the List to be created and then browse the Excel Sheet to be uploaded


4. Clicking on Import option, you will find see a popup window opens. Select Range of Cells in the Range Type


5. This option allows you to select the table columns and rows in excel as shown below. After selecting, you will see the selected field’s column and row data being populated in the Select Range field in the popup window


6. Now click on Import in the popup window. Your SharePoint list will be created from the Excel Sheet and the values are also populated as shown below:


You may face some issues while importing the Excel Sheet to SharePoint and the solution is follows:

Error: “Method ‘Post’ of object ‘IOWSPostData’ failed” in SharePoint


Solution:

 Ø  Open the Excel Sheet Add-In EXPTOOWS.XLA which will is available at the following location C:\Program Files\Microsoft Office\Office12\1033 by default.

 Ø  Press Alt+F11 to display the Visual Basic code editor. Locate the form named "PublishForm" under the folder "Forms" and open the code view of this form.

 Ø  Search (Ctrl+F) for the line "lVer = Application.SharePointVersion(URL)" and place a new line "lVer=2" after that line.

 Ø  Now try to import the Excel Sheet to the SharePoint, you will not get any errors.


Error: "The specified file is not a valid spreadsheet or contains no data to import"




Solution:

This error occurs when the site you are opening do not have permission to file system. To give permission follow the below steps:

In Internet Explorer click Tools --> Internet Options -> Click Security tab --> Select Trusted Sites --> In the Sites add your URL here.

Now you will be able to import the file properly.

Hope this post helps you! Please free to comment and share this post.

Sunday, 27 May 2012

Monday, 14 May 2012

Exceptions-log4net

log4 net
-----------------------------------------------------
config settings---

<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="MonitorVendors.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>

<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net"/>
</configSections>


<log4net>
<root>
<level value="DEBUG" />
<appender-ref ref="LogFileAppender" />
</root>
<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender" >
<param name="File" value="C:\log.txt" />
<param name="AppendToFile" value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="2MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%-5p%d{yyyy-MM-dd hh:mm:ss} – %m%n" />
</layout>
</appender>
</log4net>

private static readonly ILog LogExamp = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
--------------------------------------------------------------------------

Sunday, 13 May 2012

Excel

Excel.Application excelApp = default(Excel.Application);
Excel.Workbook excelWorkbook = default(Excel.Workbook);
Excel.Worksheet excelWorksheet = default(Excel.Worksheet);
excelApp = new Excel.Application();
excelWorkbook = excelApp.Workbooks.Open(bbi, 0,
true,
5,
"",
"",
true,
Excel.XlPlatform.xlWindows,
"t",
false,
false,
0,
true,
1,
0);
excelWorksheet = (Excel.Worksheet)excelWorkbook.ActiveSheet;
Excel.Sheets shts = (Excel.Sheets)excelWorkbook.Sheets;
int startingrowId = 23;
foreach (Excel.Worksheet sheet1 in shts)
{
excelWorksheet = (Excel.Worksheet)sheet1;

switch (excelWorksheet.Name)
{
case "***": Samplemethod();
break;
case Samplemethod2: continue;
}
}
}

---------------------------------------------------------------------

object columnA = 2;
object columnB = 3;
object columnC = new object();
object columnD = new object();
object columnE = 11;
while (((Excel.Range)excelWorksheet.Cells[startingRowId, columnA]).Value2 != null)
{
try
{
string description = ((Excel.Range)excelWorksheet.Cells[startingRowId, columnA]).Value2.ToString();
string ppString = ((Excel.Range)excelWorksheet.Cells[startingRowId, columnB]).Value2.ToString();
if (((Excel.Range)excelWorksheet.Cells[startingRowId, columnD]).Value2 != null)
{
}
startingRowId++;
}
--------------------------------------------------------------------------------------

public static void readExcelfile()
{
Excel.Application excelApp = default(Excel.Application);
Excel.Workbook excelWorkbook = default(Excel.Workbook);
Excel.Worksheet excelWorksheet = default(Excel.Worksheet);
excelApp = new Excel.ApplicationClass();

//excelWorkbook = excelApp.Workbooks.Open(@"C:Tempsample.xls", 0,
excelWorkbook = excelApp.Workbooks.Open(@"C:Tempsample.xls", 0,
true,
5,
"",
"",
true,
Excel.XlPlatform.xlWindows,
"t",
false,
false,
0,
true,
1,
0);
excelWorksheet = (Excel.Worksheet)excelWorkbook.ActiveSheet;
int index = 0;
int i = 1;
// This row,column index should be changed as per your need.
// i.e. which cell in the excel you are interesting to read.
object rowIndex = 1;
object colIndex1 = 1;
object colIndex2 = 2;
try
{
while (((Excel.Range)excelWorksheet.Cells[rowIndex, colIndex1]).Value2 != null)
{
//rowIndex = 1+index;
string firstName = ((Excel.Range)excelWorksheet.Cells[rowIndex, colIndex1]).Value2.ToString();
string lastName = ((Excel.Range)excelWorksheet.Cells[rowIndex, colIndex2]).Value2.ToString();
Console.WriteLine("Name : {0},{1} ", firstName, lastName);
rowIndex = 1 + i;
i++;
index++;
}
}
catch (Exception ex)
{
excelApp.Quit();
Console.WriteLine(ex.Message);
}
}

--------------------------------------------------------

http://support.microsoft.com/kb/302084
http://vb.net-informations.com/excel-2007/vb.net_excel_2007_open_file.htm
http://exceldatareader.codeplex.com/
http://www.codeproject.com/KB/cs/Excel_Application_in_C_.aspx
http://stackoverflow.com/questions/193092/c-how-to-add-excel-worksheet-programatically-office-xp-2003

parse csv

private static List<string[]> parseCSVFile(string path)
{
List<string[]> parsedData = new List<string[]>();
List<string> parseInfo = new List<string>();
bool readFirstLine = false;
if (File.Exists(path))
{
StreamReader readFile = new StreamReader(path);
string eachLine;
string[] eachRow;
while ((eachLine = readFile.ReadLine()) != null)
{
if (readFirstLine)
{
eachRow = eachLine.Split(new char[] { ',', '\'' }, StringSplitOptions.RemoveEmptyEntries);
parsedData.Add(eachRow);
}
else
{
readFirstLine = true;
}
}
foreach (string[] str in parsedData)
parseInfo.Add(str[0]);
}
else
{
Log.Error("File does not Exist");
}
return parsedData;
}

custom validator

protected void checkbutnclick(object source,ServerValidateEventArgs args)
{
if (btnB == false )
{
CustomValidatorClick.IsValid = false;
args.IsValid = false;
}
}

Db Connection mysql

----------------------------------------------------------
using (NpgsqlConnection npgSqlCon = new NpgsqlConnection(connectionString))
{
npgSqlCon.Open();
using (NpgsqlCommand npgsqlCmd = new NpgsqlCommand(query, npgSqlCon))
{
try
{
npgsqlCmd.Parameters.Add(new NpgsqlParameter("icu", NpgsqlDbType.Integer));
npgsqlCmd.Parameters[0].Value = 1;
npgsqlCmd.Prepare();
npgsqlCmd.ExecuteNonQuery();
}
--------------------------------------------------
public class FTPCLient
{

private string ftpIP, ftpLogin, ftpPAssword;

private FTPCLient() { }
public FTPCLient(string ip, string login, string pwd)
{

string _ip = "";
IPHostEntry Host = Dns.GetHostEntry(ip);
try
{
foreach (var addr in Host.AddressList)
{
if (addr.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
{
_ip = addr.ToString();
}
}
}
catch
{
_ip = "";
}
if (!string.IsNullOrEmpty(_ip))
ftpIP = _ip;
else
ftpIP = ip;
ftpLogin = login;
ftpPAssword = pwd;


}

public void deleteFromFTP(string targetPath)
{
var req = (FtpWebRequest)WebRequest.Create(ftpIP + "/" + targetPath);
req.Proxy = null;
req.Credentials = new NetworkCredential(ftpLogin, ftpPAssword);
req.UsePassive = true;
req.UseBinary = true;
req.KeepAlive = false;
req.Method = WebRequestMethods.Ftp.DeleteFile;
req.GetResponse().Close(); // Perform the deletion
}



public void UploadToFTP(string localPath, string targetPath)
{

string[] pathSep = targetPath.Split(new char[] { '/' });
StringBuilder stbNewPath = new StringBuilder();
foreach (string s in pathSep)
{
if (!s.Contains("."))
{
if (stbNewPath.Length < 0)
stbNewPath.Append(s);
else
{
stbNewPath.Append("/" + s);
}
}
}

if (stbNewPath.Length > 0)
{
if (!this.CheckDirectory(stbNewPath.ToString()))
{
MakeDirectory(stbNewPath.ToString());
}
}

string s1 = localPath;
byte[] releaseData = File.ReadAllBytes(s1);
FileStream h=File.OpenRead(localPath);

FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(ftpIP + "/" + targetPath);
request.Method = WebRequestMethods.Ftp.UploadFile;
request.Credentials = new NetworkCredential(ftpLogin, ftpPAssword);
request.UsePassive = true;
request.UseBinary = true;
request.KeepAlive = false;
Stream reqStream = request.GetRequestStream();
int uploadDataCount = releaseData.Length;

int beginOffset = 0;
while (uploadDataCount > 0)
{
if (uploadDataCount >= 2048)
reqStream.Write(releaseData, beginOffset, 2048);
else
reqStream.Write(releaseData, beginOffset, uploadDataCount);
beginOffset += 2048;
uploadDataCount -= 2048;
}
reqStream.Close();
}


public void UploadToFTPString(string data, string targetPath)
{

string[] pathSep = targetPath.Split(new char[] { '/' });
StringBuilder stbNewPath = new StringBuilder();
foreach (string s in pathSep)
{
if (!s.Contains("."))
{
if (stbNewPath.Length < 0)
stbNewPath.Append(s);
else
{
stbNewPath.Append("/" + s);
}
}
}

if (stbNewPath.Length > 0)
{
if (!this.CheckDirectory(stbNewPath.ToString()))
{
MakeDirectory(stbNewPath.ToString());
}
}

Byte[] releaseData = File.ReadAllBytes(data);// ms.ToArray();


FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create("ftp://" + ftpIP + "/" + Uri.EscapeDataString( targetPath ));
request.Method = WebRequestMethods.Ftp.UploadFile;
request.Credentials = new NetworkCredential(ftpLogin, ftpPAssword);
request.UsePassive = true;
request.UseBinary = true;
request.KeepAlive = false;
using (Stream reqStream = request.GetRequestStream())
{
int uploadDataCount = releaseData.Length;

int beginOffset = 0;
while (uploadDataCount > 0)
{
if (uploadDataCount >= 2048)
reqStream.Write(releaseData, beginOffset, 2048);
else
reqStream.Write(releaseData, beginOffset, uploadDataCount);
beginOffset += 2048;
uploadDataCount -= 2048;
}
reqStream.Close();
}
}


public void DownloadFromFTP(string localPath, string targetPath)
{

FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(ftpIP + "/" + targetPath);
request.Method = WebRequestMethods.Ftp.DownloadFile;
request.Credentials = new NetworkCredential(ftpLogin, ftpPAssword);
request.UsePassive = true;
request.UseBinary = true;
request.KeepAlive = false;
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
Stream ftpStream = response.GetResponseStream();

long cl = response.ContentLength;
int bufferSize = 2048;
int readCount;
byte[] buffer = new byte[bufferSize];
MemoryStream memory = new MemoryStream();
readCount = ftpStream.Read(buffer, 0, bufferSize);
while (readCount > 0)
{
memory.Write(buffer, 0, readCount);
readCount = ftpStream.Read(buffer, 0, bufferSize);
}

ftpStream.Close();
memory.Close();
response.Close();
byte[] filedata = memory.ToArray();

File.WriteAllBytes(localPath, filedata);
}



private bool CheckDirectory(string dirName)
{

try
{
FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(string.Format("ftp://{0}/{1}", ftpIP, dirName));
request.Method = WebRequestMethods.Ftp.ListDirectory;
request.Credentials = new NetworkCredential(ftpLogin, ftpPAssword);
request.UsePassive = true;
request.UseBinary = true;
request.KeepAlive = false;

using (FtpWebResponse response = (FtpWebResponse)request.GetResponse())
{
return true;
}
}
catch (WebException ex)
{
if (ex.Response != null)
{
FtpWebResponse response = (FtpWebResponse)ex.Response;
if (response.StatusCode == FtpStatusCode.ActionNotTakenFileUnavailable)
{
return false;
}
}
}
return false;
}



public bool MakeDirectory(string dirName)
{

try
{
FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(string.Format("ftp://{0}/{1}", ftpIP, dirName));
request.Method = WebRequestMethods.Ftp.MakeDirectory;
request.Credentials = new NetworkCredential(ftpLogin, ftpPAssword);
request.UsePassive = true;
request.UseBinary = true;
request.KeepAlive = false;

using (FtpWebResponse response = (FtpWebResponse)request.GetResponse())
{
return true;
}
}
catch (WebException ex)
{
if (ex.Response != null)
{
FtpWebResponse response = (FtpWebResponse)ex.Response;
if (response.StatusCode == FtpStatusCode.ActionNotTakenFileUnavailable)
{
return false;
}
}
}
return false;
}
}
}
-------------------------------------------------
public void NewFTPFolder(string newSiteName)
{
try
{
string ftpaddress = "";
string ftpusername = "";
string ftppwd = "";
FTPCLient ftpClient = new FTPCLient(ftpaddress,ftpusername,ftppwd);
string folderPath = "hello";
DirectoryInfo srcDirectoryInfo = new DirectoryInfofolderPath
string ftppth = "/";
CopyFilesToFTP(srcDirectoryInfo, ftppth, ftpClient);
}
catch (Exception error)
{
Log.Error(error.Message);
}
}

--------------------------------
public void CopyFilesToFTP(DirectoryInfo srcDirectoryInfo, string ftppath, FTPCLient ftpClient)
{
try
{
foreach (FileInfo fi in srcDirectoryInfo.GetFiles())
{
string targetFtpPath = ftppath + "/" + fi.Name;
ftpClient.UploadToFTPString(fi.FullName, targetFtpPath);
}
foreach (DirectoryInfo di in srcDirectoryInfo.GetDirectories())
{
string subdirftppath = ftppath + "/" + di.Name;
ftpClient.MakeDirectory(subdirftppath);
CopyFilesToFTP(di, subdirftppath, ftpClient);
}
}
catch (Exception error)
{
Log.Error(error.Message);
}
}
}
----------------------------------------------

Thursday, 3 May 2012

Paging for First, Next, Previous and Last in gridview

1) First  fill the gridview with Data from a Table.

2) Drag and Drop 4 Buttons keep it at the bottom of the Gridview.

3) Change the text of a buttons using Properties.

4) Select Gridview Properties and set AllowPaging=True.

5) Expand the PageSetting Properties of Gridview, and set visible property as False.

6) Next we have to set a gridview PageSize property. The Default

PageSize is 10.you can keep how  much size you want to display rows per page.

Here I kept 6 rows to display in gridview per page. You can observe how to set

page in 'Pagesetting Picture' marked with yellow color...

7) Under SelectedRowStyle set 'ShowFooter as False'

 

8) The Ouptput of your gridview Image is shown below.

 

How to Write the Code for Paging First, Next, Previous and Last.

 

1)     Paging for First Button: Double click on 'First' Button and write the below code.
protected void btnfirst_Click(object sender, EventArgs e)

{

gridview1.PageIndex = 0;

}

Explantion: when you run the Page it contains 6 recors in Gridview.

Suppose the user in last Page.When the user clicks  on 'First Button' first 6 records of the page has to be display in gridview.so the first gridview page Index(property) is 'zero'.There is a Property called 'PageIndex' for Gridview.

 

2)      Paging for Next Button: Double click on 'Next Button 'and write the below code.

protectedvoid btnnext_Click(object sender, EventArgs e)

{

int i = gridview1.PageIndex + 1;

if (i <= gridview1.PageCount)

{

gridview1.PageIndex = i;

}

}

Explanation: 'PageCount' is used to count number of pages availble in a Gridview.

 

3)     Paging for Previous Button:Double click on 'Previous Button'and write the below code.
  pProtected void btnprevious_Click(object sender, EventArgs e)

{

int i = gridview1.PageCount;

if (gridview1.PageIndex > 0)

{

gridview1.PageIndex = gridview1.PageIndex - 1;

}

}

 

4)    Paging for Last Button:Double click on 'Last Button'and write the below code

proProtectedvoid btnlast_Click(object sender, EventArgs e)

{

gridview1.PageIndex = gridview1.PageCount;

}

 

In the Above Picture observe on Last Button.it is in Enable=False state,because in gridview the last page records are displaying.So again no need with last Button.In same Senario remaining buttons also made Enable=False where the buttons are not usefull to click the user.you can see the coding fo Enable in .aspx.cs page

The Complete .aspx.cs Page

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;

 

public partial class _Default : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

 

btnfirst.Enabled = false;

btnprevious.Enabled = false;

 

}

protected void btnnext_Click(object sender, EventArgs e)

{

int i = gridview1.PageIndex + 1;

if (i <= gridview1.PageCount)

{

gridview1.PageIndex = i;

btnlast.Enabled = true;

btnprevious.Enabled = true;

btnfirst.Enabled = true;

}

if (gridview1.PageCount-1 == gridview1.PageIndex)

{

btnnext.Enabled = false;

btnlast.Enabled = false;

}

 

}

protected void btnprevious_Click(object sender, EventArgs e)

{

 

int i = gridview1.PageCount;

if (gridview1.PageIndex > 0)

{

 

gridview1.PageIndex = gridview1.PageIndex - 1;

btnlast.Enabled = true ;

}

 

if (gridview1.PageIndex == 0)

{

btnfirst.Enabled = false;

}

if (gridview1.PageCount - 1 == gridview1.PageIndex+1)

{

btnnext.Enabled = true;

}

if (gridview1.PageIndex == 0)

{

btnprevious.Enabled = false;

}

}

protected void btnlast_Click(object sender, EventArgs e)

{

gridview1.PageIndex = gridview1.PageCount;

btnlast.Enabled = false;

btnfirst.Enabled = true;

}

protected void btnfirst_Click(object sender, EventArgs e)

{

gridview1.PageIndex = 0;

btnfirst.Enabled = false;

btnprevious.Enabled = false;

btnlast.Enabled = true;

btnnext.Enabled = true;

}

}

This type of Paging is also called as Custom Paging.

Monday, 16 April 2012
















Listing C

private void cmdUpload_Click(object sender, System.EventArgs e)

{


       if (( File1.PostedFile != null) && (File1.PostedFile.ContentLength > 0))

       {

              //determine file name

              string sFileName = System.IO.Path.GetFileName(File1.PostedFile.FileName);

              try

              {

                     if (File1.PostedFile.ContentLength <= lMaxFileSize)

                     {

                           //Save File on disk

                           File1.PostedFile.SaveAs(sFileDir + sFileName);

                           lblMessage.Visible=true;

                           lblMessage.Text="File: " + sFileDir + sFileName + " Uploaded Successfully";

                     }

                     else //reject file

                     {

                           lblMessage.Visible=true;

                           lblMessage.Text="File Size if Over the Limit of " + lMaxFileSize ;

                     }

              }

              catch(Exception)//in case of an error

              {

                     lblMessage.Visible = true;

                     lblMessage.Text="An Error Occured. Please Try Again!";

                     DeleteFile(sFileDir + sFileName);

              }

       }

}


!= null) && (File1.PostedFile.ContentLength > 0))
       {

              //determine file name

              string sFileName = System.IO.Path.GetFileName(File1.PostedFile.FileName);

              try

              {

                     if (File1.PostedFile.ContentLength <= lMaxFileSize)

                     {

                           //Save File on disk

                           File1.PostedFile.SaveAs(sFileDir + sFileName);

                           lblMessage.Visible=true;

                           lblMessage.Text="File: " + sFileDir + sFileName + " Uploaded Successfully";

                     }

                     else //reject file

                     {

                           lblMessage.Visible=true;

                           lblMessage.Text="File Size if Over the Limit of " + lMaxFileSize ;

                     }

              }

              catch(Exception)//in case of an error

              {

                     lblMessage.Visible = true;

                     lblMessage.Text="An Error Occured. Please Try Again!";

                     DeleteFile(sFileDir + sFileName);

              }

       }

}

Friday, 16 December 2011

Delete the background image on YouTube

-log into youtube
-go to your channel
-click 'edit channel'
-click the blue link that says 'channel Design' on the left hand side
-go down to 'background image'
-delete the link from the box
-click 'update channel'

now the background image will no longer display on your youtube channel

 

 

other answer

*Go to "Account" then "Channel Design".

*Under channel design go to "Advanced Design Customization" then click "pick" next to "Background Color". Pick the color black at the very bottom left of the color palate.

*Then under "Repeat Background Image", click "no".

*Save this picture under "My Pictures" on your computer. http://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Color_icon_black.svg/300px-Color_icon_black.svg.png
*Next to "Background Image" on your "youtube account" page, click "Browse". Save that picture of the image to use as your background.

*Afterwards, you should be able to pick any color off of the "Background Color" option.

I hope this helps...it is kinda confusing, I know, but if you have any questions just let me know. :)
I figured it out on my own.



or



1 -- click on "ACCOUNT▼", ignoring the blue drop-down menu.
(you'll get a new page with black titles and many blue subtitles)

2 -- look on the left for the 3rd black title called "MY CHANNEL"
(you'll see 5 different blue subtitles including "Channel Design"

3 -- click on "CHANNEL DESIGN"
(you'll get a new page with nine colour combinations at the top)

4 -- scroll half-way down and look for "BACKGROUND IMAGE"
(it's the 2nd thin rectangle, with the "Browse" box just beside it)

5 -- simply DELETE THE LINK
(the rectangle should be blank)

6 -- scroll to the top of the page and click "UPDATE CHANNEL"
(it's on the grey stripe just above the nine colour combinations)

Here is the URL address of the YouTube help reference which
most closely answers your question, followed by its direct link:

www . google . com / support / youtube / bin / answer . py ? hl = en & answer = 71515
http://www.google.com/support/youtube/bi…

Wednesday, 20 April 2011

Sample example of error message infomation for site

Sorry, an error has occurred...

Unfortunately an error has occurred during the processing of your page request. Please be assured we log and review all errors, even if you do not report this error we will endeavor to correct it.

Google:
500. That’s an error.

The server encountered an error and could not complete your request.

If the problem persists, please report your problem and mention this error message and the query that caused it. That’s all we know.

Wednesday, 11 August 2010

Embed Code available sites

Google (http://video.google.com/)
Youtube (http://www.youtube.com/)
vSocial (http://www.vsocial.com/)
iFilm (http://www.ifilm.com/)
MetaCafe (http://www.metacafe.com/)
DailyMotion (http://www.dailymotion.com/)
CurrentTV (http://www.current.tv/)
Vimeo (http://www.vimeo.com/)
Sharkle (http://www.sharkle.com/)
FreeVideoBlog (http://video.freevideoblog.com/)
MyVideoDe (http://www.myvideo.de/)

Tuesday, 10 August 2010

Difference Between Grid Hosting and Shared Hosting

The main difference between shared web hosting and grid hosting is scalability.

Shared hosts have fixed capacities. It is somewhat ironic that popular sites on the shared host are punished and may face temporary unavailability of web content. There is no such thing as fixed capacity on grid hosting. An unknown site on a grid host may consume fewer resources. Over time, the same site may gain popularity but the site is allowed to increase its utilization of the grid’s computing resources

Grid hosting usually means that the web space you rent is not located on one (potentially shared) machine, but is more like a "virtual machine" (think VMware) which is hosted on a cluster of servers (a grid) and Shared hosting, sometimes called shared services or virtual hosting, is simply when multiple web sites share the same server, thus reducing the cost for everyone.

Grid hosting is when you have a site that bounces around several serviers, shared is when you're sharing server space on one server with hundreds of other users typically.

 


The logic of Seeds and Peers on Torrent websites



1. Cap your upload (most important)
Limit your upload speed to approximately 80 percent of your maximum upload rate. You can check your upload speed over here (never trust your isp). Once you know your maximum upload speed, change the max upload (to 80%) speed in your torrent client’s preferences.
Don’t get me wrong, everyone should share as much as possible, but if your upload rate reached it’s max, your download rate suffers significantly.
2. Hack the max TCP connections
If you’re on XP sp2, your TCP connections are limited to a maximum of 10. This seriously hurts your downloading speed because it wont let you connect to a high amount of ip numbers. It is supposed to slow down viruses because their spreading strategy is to connect to a high amount of ip numbers, but it also cripples your torrent downloads.
A nice way to fix this is to download this patch, it allows you to set the maximum allowed connections to any number you want. Any number between 50 and 100 is ok
3. Check seeds and peers
A simple tip, but o so important. Always look for torrents with the best seed/peer ratio. The more seeds (compared to peers) the better (in general). So 50 seeds and 50 peers is better than 500 seeds and 1000 peers. So, be selective.
4. Change the default port.
By default, BitTorrent uses a port 6881-6999. BitTorrent accounts for a lot of the total internet traffic (1/3), so isp’s like to limit the connection offered on the these ports. So, you should change these to another range. Good clients allow you to do this, just choose anything you like. If you’re behind a router, make sure you have the ports forwarded or UPnP enabled.
5. Disable Windows Firewall
It sucks. Windows Firewall hates P2P and often leads a life of it’s own. So disable it and get yourself a decent firewall, Kerio or Zone Alarm for example.
Last but not least… Buy a faster connection…
Read more on optimizing your BitTorrent Speed.


Monday, 26 July 2010

Photoshop shortcut keys

Photoshop Useful Shortcut Key Chart for Windows -

One of Photoshop's key features is that almost everything in it can be controlled using keyboard shortcuts. This allows the user to stay in a creative thought pattern and quickly change tools in monotonous work that requires it.

F1 - Toggles Adobe Online Help
F5 - Toggles Brush style palette
F6 - Toggles Colour, Swatches, Styles palette
F7 - Toggles Layers, Channels, Paths palette
F8 - Toggles Navigator, Info palette
F9 - Toggles Actions, History, Presets palette
Tab (Key) - Toggles all the palettes on screen
Shift + Tab (Key) - Toggles palettes on screen, excluding the Toolbar.






























































































Main Toolbar
KeyActionActionKey
Marquee Tool Move Tool
Lasso Tool Magic Wand Tool
Airbrush Tool Paintbrush Tool
Rubber Stamp Tool History Brush Tool
Eraser Tool Pencil Tool
Blur Tool Dodge Tool
Pen Tool Type Tool
Measure Tool Linear Gradient Tool
Paint Bucket Tool Eyedropper Tool
Hand Tool Zoom Tool
Default foreground and background colors.
Switches between foreground and background colors.
Switches between standard mode or quick mask mode.
Switches between screen modes.
TABHides/Unhides open tools.



















































ile Menu
KeyAction
CTRL + New
CTRL + Open
CTRL + ALT + OOpn As
CTRL + Wlose
CTRL + Save
CTRL + SHIFT + SSave
CTRL + ALT + SSave a Cop
CTRL + SHIFT + PPae Setup
CTRL + Print
CTRL + KPreerences > eneral











































dit Menu
KeyAction
CTRL + ZUndo
CTRL + XCu
CTRL + Copy
CTRL + SHIFT + CCopy erged
CTRL + Vaste
CTRL + SHIFT + VPaste nto
CTRL + Tree Transform
CTRL + SHIFT + TTrnsform > gain















































mage Menu
KeyAction
CTRL + Ldjust > evels
CTRL + SHIFT + Ldjust > uto Levels
CTRL + ALT + SHIFT + Ldjust > Ato Contrast
CTRL + Mdjust > Cures
CTRL + Bdjust > Color alance
CTRL + Udjust > ue/Saturation
CTRL + SHIFT + Udjust > esaturate
CTRL + Idjust > nvert
CTRL + ALT + XExtract























































ayer Menu
KeyAction
CTRL + SHIFT + New > ayer
CTRL + Jew > Layer Via opy
CTRL + SHIFT + Jew > Layer Via Cu
CTRL + Group with Previous
CTRL + SHIFT + Gngroup
CTRL + SHIFT + ]rrange > Bring to ront
CTRL + ]rrange > Bring Forard
CTRL + [rrange > Send Bacward
CTRL + SHIFT + [rrange > Send to ack
CTRL + Erge Down
CTRL + SHIFT + EMerge isible































elect Menu
KeyAction
CTRL + All
CTRL + Deselect
CTRL + SHIFT + Dselect
CTRL + SHIFT + Inverse
CTRL + ALT + Deather



















Filer Menu
KeyAction
CTRL + FLast ilter
CTRL + SHIFT + FFa



































































iew Menu
KeyAction
CTRL + YPrview > MYK
CTRL + SHIFT + YGamut arning
CTRL + +Zoom
CTRL + -Zoom ut
CTRL + 0it on Screen
CTRL + SHIFT + 0ctual Pixels
CTRL + HHide Eges
CTRL + SHIFT + HHide Pat
CTRL + RShow ulers
CTRL + ;Hide Gides
CTRL + SHIFT + ;Snap o Guides
CTRL + ALT + ;Loc Guides
CTRL + "Show rid
CTRL + SHIFT + "ap To Grid















elp Menu
KeyAction
F1ontents











































Other Shortcuts
KeyAction
Page Up/DownMove view up/down 1 screen.
SHIFT + Page Up/DownNudge view up/down.
CTRL + Page Up/DownMove view left/right 1 screen.
CTRL + SHIFT + Page Up/DownNudge screen left/right.
CTRL + SHIFT + ZPrevious History entry.
CTRL + ALT + ZNext History entry.
SHIFT + -Previous blending mode.
SHIFT + +Next blending mode.


Ctrl Short Cuts -

Ctrl + N - New Document Dialogue Box
Ctrl + M - Curves Dialogue Box
Ctrl + A - Selects all in the currently foreground document or currently selected layer
Ctrl + D - Deselects all in the currently foreground document or currently selected layer
Ctrl + J - Automatically creates a duplicate of the currently selected layer
Ctrl + K - Preferences Dialogue Box
Ctrl + L - Levels Dialogue Box
Ctrl + F4 - Closes current document
Ctrl + ' (Single Quote Key) - Toggles Grid Lines
Ctrl + Q - Quits Photoshop altogether
Ctrl + R - Toggles Rulers
Ctrl + U - Hue/Saturation Dialogue Box
Ctrl + O - Opens New File
Ctrl + P - Print Dialogue Box
Ctrl + Z - Undo last Action
Ctrl + Tab - Toggle between open documents
Ctrl + Shift + C - Copy Merged
Ctrl + C - Copy
Ctrl + H - Toggle Extras
Ctrl + ; - Toggle Guides
Ctrl + Shift + ; - Toggle Snap
Ctrl + X - Cut
Ctrl + Alt + Shift + X - Pattern Maker
Ctrl + V - Paste
Ctrl + Shift + V - Paste into selection
Ctrl + Alt + Shift + V - Paste Outside
Ctrl + T - Transform Tool
Ctrl + Shift + T - Repeats the last performed Transform
Shift + F5 / Shift + Backspace (Key) - Fill Layer Dialogue Box
Combination Number 9 Shortcuts - Ctrl + Shift / Alt -


Ctrl + Shift + O - Photoshop's File Browser
Ctrl + Shift + P - Page Setup Dialogue Box
Ctrl + Shift + S - Save As Dialogue Box
Ctrl + Shift + K - Color Setting Preferences Box
Ctrl + Shift + F - Fade Dialogue Box
Ctrl + Shift + X - Liquify Filter Tool
Ctrl + Shift + N - Create New Layer Preferences Box
Ctrl + Shift + M - Launches ImageReady
Ctrl + Shift + E - Merges all layers into a single layer
Ctrl + Alt + Z - Step Backward
Ctrl + Shift + - (Minus Sign Key) - Zoom Out
Ctrl + Shift + + (Plus Sign Key) - Zoom In
Ctrl + Shift + Alt + N - Creates a new empty layer
Ctrl + Shift + Alt + S - Save For The Web Dialogue
Ctrl + Alt (in most Dialogue Boxes) - Changes the 'Cancel' command to 'Reset'
Ctrl + Alt (in the 'Save For Web Dialogue') - Changes the 'Cancel' command to 'Reset' & the 'Done' command to 'Remember'
Ctrl + Alt + ~(Tild Symbol) - Selects the brightest area of the currently selected layer
Ctrl + Shift + I - Inverts a selection
Ctrl + Alt + X - Extract
Shift + -/+ signs(on a layer) - Toggles the different layer modes
Shift + Ctrl + Z - Step Forward


File Menu Shortcuts:


Ctrl+N: New Document
Ctrl+O: Open Document
Shift+Ctrl+O: Browse
Alt+Ctrl+O:Open As
Ctrl+W: Close
Ctrl+Shift+W: Close All
Ctrl+S: Save
Ctrl+Shift+S: Save As
Ctrl+Alt+S: Save a Copy
Ctrl+Alt+Shift+ S: Save for Web
Ctrl+Shift+P: Page Setup
Ctrl+Shift+M: Jump to Image Ready
Ctrl+Q: Exit
Viewing Shortcuts:



Ctrl+Y: Proof Colors
Ctrl++: Zoom In
Ctrl+-: Zoom Out
Ctrl+Alt++: Zoom In & Resize Window
Ctrl+Alt+-: Zoom Out & Resize Window
Ctrl+Alt+0: Actual Pixels
Ctrl+Shift+H: Show/Hide Target Path
Ctrl+R: Show/Hide Rulers
Ctrl+Shift+; : On/Off Snap
Ctrl+H: Show/Hide Extras
Ctrl+Alt+;: Lock Guides
Ctrl+;: Show Guides
Ctrl+': Show Grid
Tools Shortcuts:



A: Path Component Selection Tool
B: Paintbrush Tool
C: Crop Tool
D: Changes Default Colour Palettes To Black Foreground, White Background
E: Eraser Tool
F: Cycle Screen Modes
G: Gradient Tool
H: Hand Tool
I: Eyedropper Tool
J: Airbrush Tool
K: Slice Tool
L: Lasso Tool
M: Marquee Tool
N: Notes
O: Dodge/Burn/Sponge Tool
P: Pen Tool
Q: Quick Mask
R: Blur/Sharpen/ Smudge Tool
S: Clone Stamp
T: Type Tool
U: Shape Tool
V: Move Tool
W: Magic Wand
X: Swap Colours On Colour Pallete
Y: History Brush
Z: Zoom Tool
Layer Shortcuts:



Ctrl+Shift+N: New Layer
Ctrl+J: Layer via Copy
Ctrl+Shift+J: Layer via Cut
Ctrl+G: Group with Previous
Ctrl+Shift+] : Bring to Front
Ctrl+]: Bring Forward
Ctrl+[: Send Backward
Ctrl+Shift+[ : Send Back
Ctrl+E: Merge Layers
Ctrl+Shift+E: Merge Visible
Image Manipulation Shortcuts:



Ctrl+L: Adjust Levels
Ctrl+Shift+L: Adjust Auto Levels
Ctrl+Alt+Shift+ L: Adjust Auto Contrast
Ctrl+M: Adjust Curves
Ctrl+B: Adjust Color Balance
Ctrl+U: Adjust Hue/Saturation
Ctrl+Shift+U: Desaturate
Ctrl+I: Invert
Ctrl+Alt+X: Extract
Filters Shortcuts:



Ctrl+F: Last Filter
Ctrl+Shift+F: Fade
Ctrl+Alt+X: Extract
Ctrl+Shift+X: Liquify
Ctrl+Shift+Alt+ X: Pattern Make
Selection Shortcuts:



Ctrl+A: Select All
Ctrl+D: Deselect
Ctrl+Shift+D: Reselect
Ctrl+Shift+I: Inverse
Ctrl+Alt+D: Feather
Random Shortcuts:



Alt+Backspace: Fill with Forground Color
Shift+Backspace: Fill with Background Color
Alt+]: Ascend through Layers
Alt+[: Descend through Layers
Shift+Alt+]: Select Top Layer
Shift+Alt+[: Select Bottom Layer
Tab: Show/Hide All Palettes

A Beginners Guide to Photoshop



A Beginners Guide to Photoshop




This is a pretty awesome tutorial on everything you need to know about Photoshop. From the basics to the explination of almost everything in Photoshop.

The Workspace



Tools Palette:
Self explanatory - the palette that contains the tools that can be used to directly edit the image.
Tool Options:
A selection of options that relate to the currently selected tool and alter its effects.
Drop down menus:
Standard drop down menus as seen in most Windows and Macintosh applications. Offers access to most of Photoshop's features. Commands for the drop down menus in these tutorials are written in bold.
Info Palette:
Shows information about the current image, or shows a thumbnail via which you can navigate the image. Information provided includes crop/selection area, file size, image dimensions, etc.
Colours/Styles Palette:
Allows you to select a colour via RGB sliders or preset web-safe colours ('Swatches'). Also lets you apply layer styles - preset combinations of layer styles (effects) that can achieve effective results if you're in a hurry. Use the expansion arrow (just undereath the close button) to load more styles that are included with Photoshop.
History Palette:
Gives a list of actions that can be undone - lists around one hundred. You can save snapshots to return to at key points in your image creation, or return to the saved file/a recent step. Also contains actions and tool presets for the currently selected tool.
Layers Palette:
The layers palette has many features, too many to list here. They are described later in the tutorial.

Layers



Palette Objects

Layer Opacity:
The opacity of the current layer, 0-100%.
Blending Mode:
The manner in which this layer interacts with layers below it. See below.
Active/Linked Layers:
A small paint brush icon appears in this space to indicate the active layer, and chain icons signify other layers that are linked with the active layer.
Layer visibility:
An eye in this area signifies that the layer is visible, and an empty box means it is hidden from view and exempt from formatting.
Layers:
Two example layers showing an example background layer and new (transparent) layer (Layer 1).
New Fill/Adjustment Layer:
Creates a layer that can add a gradient to or adjust the hue, etc. of the layer below.
New Layer:
Creates a new layer [ctrl/cmd + shift + N].
Delete Layer:
Deletes the currently selected layer.
New Layer Set:
Creates a folder for layers to be put into for easy organisation of layers.
New Layer Mask:
Creates a sub-layer with which you can use all normal tools. Adding black to a layer mask, for example, means that that part of the layer is invisible.
Layer Effects (Styles):
Applies various effects to the current layer - can also be reached via Layer || Layer Style.

Blending Modes



Normal/Dissolve:
All layers appear as normal - dissolve doesn't blend the colours that are layered, but instead applies the colour to pixels at random in accordance.
Darken > Linear Burn:
Subtly different methods of darkening the layers beneath the selected layer.
Lighten > Linear Dodge:
Subtly different methods of lightening the layers beneath the selected layer.
Overlay:
Crudely put, reduces the opacity of the layer.
Soft Light > Pin Light:
Methods of lightening layers below the current one at varying strengths.
Difference/Exclusion:
Quite complicated - this is as it appears in the PS help files: "Looks at the color information in each channel and subtracts either the blend color from the base color or the base color from the blend color, depending on which has the greater brightness value. Blending with white inverts the base color values; blending with black produces no change." Exclusion is pretty much the same but at lower contrast.
Hue > Luminosity:
Effects the respective value of the layer below.

Tools



Marquee Tool
The marquee tool selects areas within a layer. It is capable of selecting an elliptical, square, single column, and single rows.
Move Tool
The move tool can move around all objects within a layer. To move entire image, Flatten the layers by selecting Layer > Flatten Image.
Lasso Tool
The lasso tool can select areas within in a layer that can’t be reached with the marquee tool.
Magic Wand
The magic wand is an automatic selection tool. It selects everything in the layer.
Cropping tool
This tool changes the size of the image. To use, Select the area you want to crop and then press enter.
Slice Tool
Makes Guidelines.
Heal Brush Tool and Patch Tool
The patch tool is another form of the heal brush. It is in the options for the heal brush. The Heal Brush deletes the high contrast of a picture and is used when retouching a photo. To use, hold down alt while clicking on the source (an area that looks like what you want the damaged part to look like) and drag the mouse around the damaged picture to repair it.
The patch tool fixes damaged parts of a picture by blending the damaged part with a better one. Just use the patch tool to select part of the image, then drag the selection to another part of the image. This will combine the selections.

Pencil tool and brush tool
Draws or paints a line. Same as the pencil or brush tool in paint. Change the color of the paint brush by clicking on the color picker .
Clone Stamp Tool and Pattern Stamp tool
The clone stamp tool duplicates part of the image. Hold down alt while clicking to choose the part of the image which you want to duplicate. Drag the mouse over the damaged area.
The pattern stamp tool can create and save a pattern you want to use over and over again. To make a pattern, use the marquee tool or the lasso tool to select part of the image. Go to Filter > Pattern Maker and click generate. Click on the floppy disk underneath the Tile History called Save Preset Pattern. This will save the pattern. Do not push OK unless you want to fill the entire image with that pattern. Press cancel and select your pattern from Pattern on the top center of Photoshop. Drag the mouse over the area with the pattern stamp tool to edit the picture.

History Brush Tool and Art History Brush
The history Brush tool can go back and undo certain changes in a picture. To delete everything you did since the opening of the picture simply drag the history brush over the area to be repaired. The history brush works best when transforming snap shots. Using the snap shot will only change certain parts of the picture and can go back in editing to change major errors. To make a Snap Shot, save the picture then click on the small camera on the bottom of the history window. The snap shot will be saved once it is named. If you click on a previous snap shot, you can edit a previous version of your picture. Click on the last snap shot then use the history brush tool to undo the editing to make the unedited section look like the previous snap shot.
The Art history Brush tool can artistically undo an image and warp the original picture. Click on the top snap shot and chose what kind of brush to use on the top of the window under Style. Click on the area you want to edit with the art history brush.

Eraser tool
This can erase part of the photo in a certain layer. To erase everything in a certain area to make it white, flatten the image or go through every layer to delete that part.
Paint Bucket
Makes an area one color. To edit all layers at one time, click on All layers at the top of the window.
The Blur tool, Sharpen Tool, and Smudge Tool
To use, drag over part of photo you want to edit. The hardest part of this tool is selecting the right strength, brush size and mode. This tool is capable of blurring part of the image, undoing the blur with the sharpen tool, and slightly liquefying with the smudge tool.
The Dodge tool, Burn tool, and Sponge tool
To use any of these tools, just drag it over the image. The dodge tool can lighten an image, the burn tool darkens it, and the sponge tool soaks color out of the image.
Text tool
Puts text in a picture. Click on the picture with the type tool and select a box the size of the area you want to add text. Type in the box then adjust the size of the text box.
Pen Tool
The pen tool can make lines and be used with shape tools to create different shapes. To create lines, use the pen tool to create anchors (the little boxes on a line) and change the shape of the line by moving around the anchors.
Custom Shape Tools
Creates shapes in the image. The custom shapes tools can create all shapes in the shape section located at the top center of the Photoshop window.
Annotation tool
This can create notes and sound effects in an image. The only difference between the note tool and the text tool is that the note comes up in a little white box and when the note is too long for the given space, there will be a scroll bar. This is usually used in PDF formats and Acrobat Documents.
The audio Annotation tool can add audio notation to the picture. To use, click on the audio notation tool and press start. Record your voice with the microphone then press stop. You can import the audio by File > Import > Annotations. Make sure the file you import is a PDF file or a FDF file.

Eyedropper tool
Samples a color from the picture, color swatches, or the color picker. To use, click on the color on the image you want to take and right click.
Hand Tool
Moves around image within an object. Is used with the zoom tool when you want to adjust the section of picture you want to look at.
Zoom tool
Zooms in on part of the picture for closer editing.