Saturday, September 30, 2023

PRINTING CONCEPTS

DESIGN PAGES

Form 1 design:


Form 2 design:


DOT NET CODING

Form 1 Coding:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Configuration;
using System.Collections;
using System.Drawing.Printing;
using System.Globalization;
namespace Ruled_Paper
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Font font1 = new Font("Times New Roman", 9);    // Default Text
Font font2 = new Font("Times New Roman", 10);    // BillNo, Date & Customer Id & coloum name
Font font3 = new Font("Times New Roman", 10, FontStyle.Bold);  // Company Name, Bill Heading [Ex: ESTIMATE]
Font font4 = new Font("Times New Roman", 9);    // Header, Footer
Font font5 = new Font("Times New Roman", 10);
Font font6 = new Font("Times New Roman", 14, FontStyle.Bold);
int X, Y, pageWidth, offsetY, rightMargin;
SolidBrush brush = new SolidBrush(Color.Black);
Pen dashPen = new Pen(Color.Black, 1);
Graphics g; Int32 pageHeight;
private void button1_Click(object sender, EventArgs e)
{
PrintDialog prdialog = new PrintDialog();
PrintDocument prdoc = new PrintDocument();
PrinterSettings prsetting = new PrinterSettings();
prdialog.Document = prdoc;
IEnumerable<PaperSize> paperSizes = prsetting.PaperSizes.Cast<PaperSize>();
PaperSize paperSize = new PaperSize("Custom", 480, pageHeight); // 400,500
prdialog.Document.DefaultPageSettings.PaperSize = paperSize;
}
private void printPreviewControl1_Click(object sender, EventArgs e)
{
PrintDialog prdialog = new PrintDialog();
PrintDocument prdoc = new PrintDocument();
PrinterSettings prsetting = new PrinterSettings();
prdialog.Document = prdoc;
IEnumerable<PaperSize> paperSizes = prsetting.PaperSizes.Cast<PaperSize>();
PaperSize paperSize = new PaperSize("Custom", 480, pageHeight); // 400,500
prdialog.Document.DefaultPageSettings.PaperSize = paperSize; 
}
}
}


Form 2 Coding:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Printing;
namespace Ruled_Paper
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
int x = 100, y = 100;
Graphics graphics;
private void Form2_Load(object sender, EventArgs e)
{
top();
}
public string hari { get; set; }
Font font1 = new Font("Times New Roman", 11, FontStyle.Bold);
void sam_Printpage(Object sender, PrintPageEventArgs e)
{
graphics = e.Graphics;
Font headerFont = new Font("Times New Roman", 20, FontStyle.Bold);
graphics.DrawString("Date:___/___/______", headerFont, Brushes.Red, 550, 35);
string hariText = "Page No.:___";
Font bodyFont = new Font("Times New Roman", 20, FontStyle.Bold);
graphics.DrawString(hariText,bodyFont, Brushes.Red, 550, 5);
graphics.DrawLine(Pens.Red, 1, 100, 1000, 100);
graphics.DrawLine(Pens.Red, 1, 95, 1000, 95); //horizontal
graphics.DrawLine(Pens.Black, 1, 200, 1000, 200);
graphics.DrawLine(Pens.Black, 1, 150, 1000, 150);
graphics.DrawLine(Pens.Black, 1, 200, 1000, 200);
graphics.DrawLine(Pens.Black, 1, 250, 1000, 250);
graphics.DrawLine(Pens.Black, 1, 300, 1000, 300);
graphics.DrawLine(Pens.Black, 1, 350, 1000, 350);
graphics.DrawLine(Pens.Black, 1, 400, 1000, 400);
graphics.DrawLine(Pens.Black, 1, 450, 1000, 450);
graphics.DrawLine(Pens.Black, 1, 500, 1000, 500);
graphics.DrawLine(Pens.Black, 1, 550, 1000, 550);
graphics.DrawLine(Pens.Black, 1, 600, 1000, 600);
graphics.DrawLine(Pens.Black, 1, 650, 1000, 650);
graphics.DrawLine(Pens.Black, 1, 700, 1000, 700);
graphics.DrawLine(Pens.Black, 1, 750, 1000, 750);
graphics.DrawLine(Pens.Black, 1, 850, 1000, 850);
graphics.DrawLine(Pens.Black, 1, 950, 1000,950);
graphics.DrawLine(Pens.Black, 1, 800, 1000, 800);
graphics.DrawLine(Pens.Black, 1,900, 1000, 900);
graphics.DrawLine(Pens.Black, 1, 1000, 1000, 1000);
graphics.DrawLine(Pens.Black, 1, 1050, 1000, 1050);
graphics.DrawLine(Pens.Black, 1, 1050, 1000, 1050);
graphics.DrawLine(Pens.Black, 1, 1050, 1000, 1050);
graphics.DrawLine(Pens.Black, 1, 950, 1000, 950);
graphics.DrawLine(Pens.Black, 1, 950, 1000, 950);
graphics.DrawLine(Pens.Black, 1, 950, 1000, 950);
graphics.DrawLine(Pens.Black, 1, 950, 1000, 950);
graphics.DrawLine(Pens.Black, 1, 950, 1000, 950);
graphics.DrawLine(Pens.Black, 1, 950, 1000, 950);
graphics.DrawLine(Pens.Black, 1, 950, 1000, 950);
graphics.DrawLine(Pens.Black, 1, 200, 1000, 200);
graphics.DrawLine(Pens.Black, 1, 150, 1000, 150);
graphics.DrawLine(Pens.Black, 1, 200, 1000, 200);
graphics.DrawLine(Pens.Black, 1, 850, 1000, 850);
graphics.DrawLine(Pens.Black, 1, 950, 1000, 950);
graphics.DrawLine(Pens.Black, 1, 800, 1000, 800);
graphics.DrawLine(Pens.Black, 1, 900, 1000, 900);
graphics.DrawLine(Pens.Red,100, 5, 100, 1100);//vertical
graphics.DrawLine(Pens.Red, 105, 5, 105, 1100);
}
public void top()
{
PrintDocument printDocument = new PrintDocument();
printDocument.DefaultPageSettings.PaperSize = new PaperSize("A4", 827, 1169);
printDocument.PrintPage += new PrintPageEventHandler(sam_Printpage);
PrintPreviewDialog printPreviewDialog = new PrintPreviewDialog();
printPreviewDialog.Document = printDocument;
if (printPreviewDialog.ShowDialog() == DialogResult.OK)
{
printDocument.Print();
}
}
}
}

OUTPUT PAGE:










Sunday, September 17, 2023

DOT NET SAMPLE PROJECTS

 .NET PROJECTS

1.ARITHMETIC OPERATIONS

Form Design:


Program Coding:

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

namespace Arithmetic_Operation

{

public partial class Form1 : Form

 {

public Form1()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

if (comboBox3.Text == "+") 

 {

textBox2.Text = (Convert.ToInt32(comboBox1.Text) + Convert.ToInt32(comboBox2.Text)).ToString();

 }

 if (comboBox3.Text == "-")

{

 textBox2.Text = (Convert.ToInt32 (comboBox1.Text) - Convert.ToInt32 (comboBox2.Text)).ToString();

}

if (comboBox3.Text == "*") 

{

 textBox2.Text = (Convert.ToInt32 (comboBox1.Text) * Convert.ToInt32 (comboBox2.Text)).ToString();

}

if (comboBox3.Text == "/") 

{

textBox2.Text = (Convert.ToInt32 (comboBox1.Text) / Convert.ToInt32 (comboBox2.Text)).ToString();

}

}

private void button2_Click(object sender, EventArgs e)

{

comboBox5.Items.Add(comboBox4.Text);

}

private void button3_Click(object sender, EventArgs e)

{

comboBox4.Items.Add(textBox2.Text);

}

}

}


Output:


2.EB BILL

Form Design:

Program Coding:

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

namespace EB_Bill

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

textBox4.Text = (Convert.ToInt32(textBox3.Text) - Convert.ToInt32(textBox2.Text)).ToString();

}

private void button2_Click(object sender, EventArgs e)

{

if(Convert.ToInt32 (textBox4.Text)<101);

{

textBox5.Text=("1").ToString();

}

if(Convert.ToInt32 (textBox4.Text)<201);

{

textBox5.Text=("2").ToString();

}

{

textBox6.Text = (Convert.ToInt32(textBox5.Text) * 100).ToString();

}

}

}

}

Output:


3.ALGEBRA FORMULA
Form Design:


Program Coding:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Algebra_formula
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
textBox3.Text = (Convert.ToInt32(textBox1.Text) + Convert.ToInt32(textBox2.Text)).ToString();
textBox3.Text = (Convert.ToInt32(textBox3.Text) * Convert.ToInt32(textBox3.Text)).ToString();
}
private void button2_Click(object sender, EventArgs e)
{
textBox3.Text = (Convert.ToInt32(textBox1.Text) - Convert.ToInt32(textBox2.Text)).ToString();
textBox3.Text = (Convert.ToInt32(textBox3.Text) * Convert.ToInt32(textBox3.Text)).ToString();
}
private void button3_Click(object sender, EventArgs e)
{
textBox3.Text = (Convert.ToInt32(textBox1.Text) * Convert.ToInt32(textBox1.Text) + Convert.ToInt32(textBox2.Text) * Convert.ToInt32(textBox2.Text)).ToString();
}
private void button4_Click(object sender, EventArgs e)
{
textBox3.Text = (Convert.ToInt32(textBox1.Text) * Convert.ToInt32(textBox1.Text) - Convert.ToInt32(textBox2.Text) * Convert.ToInt32(textBox2.Text)).ToString();
}
}
}

Output:


4.MOUSE MOVE 
Form Design:


Program Coding:


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Mousemove
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_MouseMove(object sender, MouseEventArgs e)
{
button2.Visible=false;
}
private void button2_MouseMove(object sender, MouseEventArgs e)
{
button2.Visible=true;
}
}
}

Output:


5.CREDIT & DEBIT
Form Design:


Program Coding:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Credit_Debit
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if(comboBox1.Text=="DEBIT")
{
textBox5.Text = (Convert.ToInt32(textBox1.Text) - Convert.ToInt32(textBox3.Text)).ToString();
textBox6.Text = (Convert.ToInt32(textBox1.Text) - Convert.ToInt32(textBox3.Text)).ToString();
}
else//(comboBox1.Text=="CREDIT")
{
textBox4.Text = (Convert.ToInt32(textBox1.Text) + Convert.ToInt32(textBox3.Text)).ToString();
textBox6.Text = (Convert.ToInt32(textBox1.Text) - Convert.ToInt32(textBox3.Text)).ToString();
}
}
}
}
Output:




Sunday, September 10, 2023

Internet Of Things (IOT)

INTRODUCTION

It is a matter of fact today that a number of IoT products have surpassed a huge number of humans on this planet.

Approximately there are around 7.62 billion humans on our planet, but to your surprise, by the year 2022 with an increasing graph of IoT devices, there may be around 20 billion IoT smart devices up and running with an increase in the demand of 5g network.

What is the Internet of Things (IoT)?

        The term IoT, or Internet of Things, refers to the collective network of connected devices and the technology that facilitates communication between devices and the cloud, as well as between the devices themselves. 

How does IoT work?

    A typical IoT system works through the real-time collection and exchange of data. An IoT system has three components:

💻Smart devices
  💻IoT application
                   ðŸ’»A graphical user interface

📞Smart devices:

        This is a device, like a television, security camera, or exercise equipment that has been given computing capabilities. It collects data from its environment, user inputs, or usage patterns and communicates data over the internet to and from its IoT application.

📞IoT application:

        An IoT application is a collection of services and software that integrates data received from various IoT devices. It uses machine learning or artificial intelligence (AI) technology to analyze this data and make informed decisions. These decisions are communicated back to the IoT device and the IoT device then responds intelligently to inputs. 

📞A graphical user interface

        The IoT device or fleet of devices can be managed through a graphical user interface. Common examples include a mobile application or website that can be used to register and control smart devices. 

Examples of IoT devices:

1) Google Home Voice Controller

Google Home Voice Controller

        Google Home Voice Controller is a smart IoT device which allows the user to enjoy features like media, alarms, lights, thermostats, control the volume and much more functions just by their voice.

2) Amazon Echo Plus Voice Controller

Amazon Echo Plus voice controller

        Amazon Echo Plus voice controller is a popular and reliable IoT device. It is capable to run songs, do phone calls, setting timers and alarms, ask questions, providing information, checking the weather, managing to-do & shopping lists, managing house instruments, and several other things.

3) Amazon Dash Button

Amazon Dash Button

Amazon Dash Button is basically a device that gets connected over internet Wi-Fi and makes sure that the user does not lack important household items like soft drinks, grocery material, medical and personal care, kids and any pet items ever again.

If a user wants to fully utilize the Dash Button, then the user must be an Amazon Prime member.

4) August Doorbell Cam

August Doorbell Cam

August Doorbell Cam is an effective IoT innovation. August Doorbell Cam allows you to answer your door from anywhere or remote location. It constantly checks your doors and also captures motion changes in your doorstep.

5) August Smart Lock

August Smart Lock

August Smart Lock has proven to be a reliable security IoT device. It allows the user to manage their doors from any location hassle-free. It helps the user to keep thieves away and family in your home.

6) Kuri Mobile Robot

Kuri Mobile Robot

Kuri is the first sort of home robot and most popular too. It is specifically designed for entertainment. Kuri interacts with the users and captures moments all around the house daily.

7) Belkin WeMo Smart Light Switch

Belkin WeMo Smart Light Switch

The WeMo Light Switch helps a user to manage your home lights from the wall, your mobile or by using your voice. This smart light switch connects to your existing home Wi-Fi network to give wireless access of your lights – with no subscription or hub required.

8) Footbot Air Quality Monitor

Footbot Air quality Monitor

Foobot is a reliable IoT device which is helpful in measuring indoor pollution and leads to improved air quality in houses, workplace, and indoor public spaces. It often gives accurate results.

9)  Flow by Plume Labs Air Pollution Monitor

Flow by Plume Labs Air Pollution Monitor

Flow Air pollution is an amazing discovery in the IoT market. It is a personal air quality tracker which informs the user in which area the air quality is bad and polluted and vice versa. It shows all the results in the map available in its app.

10)  Nest Smoke Alarm

Nest Smoke Alarm

Nest Smoke Alarm is a very useful IoT device. It is a smoke alarm that thinks, speaks and alerts your mobile phone about any un-wanted emergencies in your home. It automatically tests itself.

11) Nest T3021US Learning Thermostat Easy Temperature Control

Nest T3021US Learning Thermostat Easy Temperature Control

It helps to control the home’s temperature and cooling environment with no effort from the user for Nest thermostat. It adapts according to your activities and manages room the temperature automatically based on your routine.

12) Philips Hue Bulbs and Lighting System

Philips Hue Bulbs and Lighting System

Philips Hue is a very famous IoT device and is used as a personal wireless lighting system that allows to control your light and create the right ambiance for every moment.

It makes the smart home to live with the most connected lights in the world.

13) Bitdefender BOX IoT Security Solution

Bitdefender BOX IOT Security Solution

Bitdefender Box is a very useful IoT device. It is the Smart Home Cybersecurity Hub that prevents various Internet-connected devices from malware, stolen passwords, identity theft, spying etc.

14) Ring Doorbell

Ring Doorbells

Ring Doorbells is a reliable IoT product and allows the user to answer the door from any place using your smartphone. Protect your home with security cameras from Ring video doorbell.

15) WeMo Insight Smart Plug

WeMo Insight Smart Plug

WeMo smart plug is a good IoT product which helps to turn on your lights, turn appliances on/off and provides the ability to monitor them from anywhere remotely.

16) Logitech Harmony Universal Remote

Logitech Universal Remote

Logitech Harmony is a powerful and useful IoT smart device for daily purposes. It is a universal remote which lets you control your house media, lighting, and other smart devices from one location remotely.

17) Particle Photon Wi-Fi with Headers

Particle Photon Wi-Fi with Headers

This is the particles IoT board which provides everything that a user needs to build a connection project. It makes prototyping simple and easy due to plugins.

18) NETGEAR Orbi Ultra-Performance Whole Home Mesh Wi-Fi System

NETGEAR Orbi

It is an extremely powerful Internet of Things device which maintains the whole-home mesh Wi-Fi system that is capable to cover the whole house with fast WI-FI. It can work with the existing internet service provider.

IoT Life Cycle:

     IoT has a very simple lifecycle of development.
    Deployment followed by monitoring, servicing, managing, which is followed by regular updates and decommissioning at the end.

IOT Device Life Cycle

Advantages Of IoT Devices:

  • IoT encourages the interaction between devices called as a machine to machine interaction.
  • It provides good automation and control.
  • Integrated with more technical information, so it is better to operate.
  • IoT possesses strong monitoring feature.
  • It saves a lot of time.
  • IoT helps to save more money by reducing manual task and time.
  • Automating daily life tasks makes good monitoring of devices.
  • Increased efficiency and time-saving.
  • With good features make a better quality of life.

Disadvantages of IoT Devices: 

  • Internet of Things devices does not have any international compatibility standard.
  • They may become highly complex resulting in failure.
  • Internet of Things devices may get affected by privacy and security breach.
  • Reduced safety for users.
  • Reduction in the employment of manual tasks thus resulting in job reductions.
  • Internet of Things device may take control of life in due course of time with increasing AI technology.

Frequently Asked Questions For The Internet Of Things Devices

    Some of the Frequently Asked Questions for the Internet of Things devices are enlisted below for your reference:

1) What are IoT devices?

Answer: IoT devices are basically smart devices which have support for internet connectivity and are able to interact with the other devices over the internet and grant remote access to a user for managing the device as per their need.

2) What are the examples of IoT devices?

Answer: There are several top devices in the market. Smart Mobiles, smart refrigerators, smartwatches, smart fire alarms, smart door locks, smart bicycles, medical sensors, fitness trackerssmart security system, etc., are few examples of IoT products.

3) How many IoT smart devices may be there by the year 2022?

Answer: IoT device market is increasing drastically, hence it is assumed to have more than 20 billion IoT products in the market up and in running state by the year 2022.

4) What technologies are used in IoT products?

Answer: The technologies used in these devices are low energy wireless and Bluetooth, NFC, LTE, ZigBee, wireless protocols etc.

5) What exactly is the use of an IoT product/device?

Answer: IoT product/devices are basically physical devices integrated with software and can connect with each other over the internet to exchange information, they help the user for more simple and direct integration of the physical world.

CONCLUSION

Internet of Things IoT device is a burning topic in the current era. We understood how these smart devices developed by mankind for mankind are impacting in both positive and negative ways.

We saw how this technology which is increasing drastically is going to impact the future of mankind and the working principle of IoT devices. 

With these points, we believe the time is not too far, in which we will see each and every individual, home using and depending on these “Internet of Things”.

Cryptography and How to use their techniques in c#

  What is Cryptography? Cryptography is the process of hiding or coding information so that only the person a message was intended for can r...