User Photo 
User image.
Articles 
Page Size: Previous
1
2
Next
Details

C# Beginner - How To Create a Class. Demonstrating the A, B, C's of a class. Plus P.

A class is composed of Attributes, Constructors, Behaviors, and Properties.

Attributes is a variable that is used within the class.

A constructor is what is used to set the values of the attributes. The attributes values can also be set without the use of a constructor.

Behaviors are methods that are within a class.

Properties are what are used to set the values of the attributes.



A normal class looks like the following:



One thing I always remember is that a class is an instance of an object. Meaning that a class represent, for example, a car. A car

is composed of color, speed, make, model, year, etc. All are considered attributes and properties can be set. A behavior could be "Move" which would move the car when called upon.


To use the class you would simple do:




There are many ways to set up a class, however I preffer the way that was shown on this example because for me it is easy to understand. As you get better you will understand that as you get better you will do one thing a certain way then whatever you made a few hours later you might say, "I could have done this, this way which could clean up the code a bit more and could have saved me a few seconds in typing a few extra lines of code.".



Details

CSharp – Creating /storing a PDF Document with Tables, Paragraphs, watermark, and images

A while back I had to do a small project. The project involved showing data from the database in a pdf. I searched online and found PDFSharp, iText, and iTextSharp. However, I went with PDFSharp, since it is possible to use PDFSharp for commercial use. However with iText you can post, add javascript, and fill in fields. With PDFSharp it is possible to fill in fields, but there is a small clitch that when you go to type something on the field, the original text hovers over the text you are typing; sort of like a watermark that never goes away. However, for my purposes I didn’t need to populate any fields with any values,
which is why I went with PDFSharp.

Creating a PDF using PDFSharp is similar to creating a control (textbox, label, dropdown, etc) in csharp.

To get started you would first have to create a PDF Document with a section(at least one section is required) by doing the following:



Then you would simple add to the PDF :

How to add a paragraph:

A paragraph object must be instantiated with line breaks and text.



How to add a table:

First a table object needs to be instantiated then the columns need to be
created. After the columns are created new rows can be added with cells.





Details

Accessing Password Through conn.ConnectionString SQL Server ASP.Net

 
Using the following code a connection to the database can be made by retrieving the connection string information from the web.config.



However, if in the web.config if the connection string doesn't include "Integrated Security=True" the password will not be retrievable. Make sure to include the "Integrated Security=True" on your connection string to SQL Server. The following is a connection string with "Integrated Security=True".

     




Details

QR Code Uses and How to Create a QR Code

Introduction

QR(Quick Response) codes are 2 dimentionsal barcodes which were used mainly in Japan. However, in recent years the U.S. has started using QR codes. For example, Best Buy uses QR codes on the label tags of their products to provide more information for the item. There is a also a company called Tesco in Korea which speciallizes in the food market industry. Which placed posters of the different type of food that they offered whith QR codes. Once the person scanned the QR code for the item it would place the item in a shopping cart. Then the person would purchase the food online. The food would get delivered to the person's home without having to pay a visit to the local super market.

Dissadvantages

1. A QR code can only have one data type:
     •URL
     •Text
     •Phone number
     •SMS

2. A QR code is limited in amount of information that it can have.

3. Not everyone has a cell phone.

4. Not everyone has a cell phone that can read QR codes.

Advantages/Uses
     •Provide additional information
     •Coupons
     •URL
     •Add items to shopping cart
     •Making Flyers/Posters/Business Cards interactive

Hints

Make sure to not clutter the QR code. The more information a QR code has the harder it is for QR readers to read a QR code.

Finally, to create a QR code is simple. There is a .dll which allows for creating QR codes: http://twit88.com/platform/projects/list_files/mt-qrcode.

Example QR codes that were made with the .dll:




Conclusion

To create a QR code without having to write much code simply copy and paste what is below:


After the text portion feel free to change it to whatever you like as long as QR code supports your input and change the scale from 1-10 to make the QR code smaller or bigger. Note: The size can also be changed by adding a width and height to your image.




Details

Magnifying an Image on MouseOver with CSS and HTML


Magnifying an image with CSS and HTML isn't very complicated. The following sets styleing to the background of the body  and appropriate links to create the illusion of an image being magnified. There is actually two images that are on the webpage which is actually a dissadvantage since both images have to be loaded onto the webpage. The advantage is that the magnifying is done with only CSS and HTML which is great because I have heard that it is bad to use a lot of JavaScript on  websites that are visited a lot by people using Mobile Devices since Mobile Devices don't render JavaScript well.




There is a few fixes for IE since IE will display the magnified image a little off OnMouseover
if the following fixes are not in place:





Skip Navigation Links.

Users

ads and stuff