Powered by Blogger.

Wednesday, 25 January 2023

C# program to Print Hello World!

 

Introduction

C# Program to Print “Hello, World!”. This program is compiled and tested on a Visual Studio 2012.



using System;
namespace TechStudyCSharp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World");
Console.ReadKey();
}
}
}

Result

C# program to Print Hello World!
C# program to Print Hello World!
Published: By: Code Tutorial - January 25, 2023

How to Hack WiFi Password

 

How to Hack WiFi Password



In this practical scenario, we are going to learn how to crack WiFi password. We will use Cain and Abel to decode the stored wireless network passwords in Windows. We will also provide useful information that can be used to crack the WEP and WPA keys of wireless networks.





Decoding Wireless network passwords stored in Windows


Step 1) Download the Cain and Abel tool

  • Download Cain & Abel from the link (Cain&Abel).
  • Open Cain and Abel



WiFi Password Hacker




Step 2) Select the Decoders tab and choose Wireless passwords




  • Ensure that the Decoders tab is selected then click on Wireless Passwords from the navigation menu on the left-hand side
  • Click on the button with a plus sign

How to Hack WiFi Password

Step 3) The passwords will be shown




  • Assuming you have connected to a secured wireless network before, you will get results similar to the ones shown below

Crack Wi-Fi Network



Step 4) Get the passwords along with encryption type and SSID

  • The decoder will show you the encryption type, SSID and the password that was used.

Summary

  • Wireless network transmission waves can be seen by outsiders, this possesses many security risks.
  • WEP is the acronym for Wired Equivalent Privacy. It has security flaws which make it easier to break compared to other security implementations.
  • WPA is the acronym for Wi-Fi Protected Access. It has security compared to WEP
  • Intrusion Detection Systems can help detect unauthorized access
  • A good security policy can help protect a network.
Published: By: Code Tutorial - January 25, 2023

Webcam Capture in C#: Easiest Way to Take Images from Your Webcams


 

Webcam Capture in C#: Easiest Way to Take Images from Your Webcams




Webcams, as an easy & cost-effective way to take images from video stream, is widely used in the business world. To save your time & energy to integrate webcam capture to your WinForms application, Dynamsoft developed the Dynamic .NET TWAIN SDK. With it, you can develop a web camera capture module in C# with a few lines of code. If you use VB.NET, please check out this blog post.

Step 1. Create your C# application for Webcam Capture






Create a simple Windows Forms Application in C#. Add Dynamic .NET TWAIN to the Toolbox: Assume you have it installed, you can browse and add DynamicDotNetTWAIN.dll in the installation folder of Dynamic .NET TWAIN (C:\Program Files (x86)\Dynamsoft\Dynamic .NET TWAIN  Trial\Redistributable).

Add Dynamic .NET TWAIN Component Dynamic .NET TWAIN in Toolbox


Step 2. Add .NET TWAIN component, picture box and the necessary buttons









Drag & drop DynamicDotNetTwain to your form to create a control: Add a picturebox to the form as the video container. Add buttons for selecting cameras, acquiring images, and removing images.  See below: Webcam Capture Windows Form

Step 3. Add code for the buttons







Select a web camera and start the video stream

//Select a source
private void btnSelect_Click(object sender, EventArgs e)
{
    try
    {
        dynamicDotNetTwain1.SelectSource();
        dynamicDotNetTwain1.SetVideoContainer(pictureBox1);
        dynamicDotNetTwain1.OpenSource();
        //List the source name and resolutions
        txtSourceName.Text = dynamicDotNetTwain1.CurrentSourceName;
        int count = dynamicDotNetTwain1.ResolutionForCamList.Count;
        for (int j = 0; j < count; j++)
        {
            string tempHeight = dynamicDotNetTwain1.ResolutionForCamList[j].Height.ToString();
            string tempWidth = dynamicDotNetTwain1.ResolutionForCamList[j].Width.ToString();
            string tempResolution = tempWidth + "X" + tempHeight;
            comboResolution.Items.Insert(j, tempResolution);
            comboResolution.SelectedIndex = 0;
        }
    }
    catch (Exception exp)
    {
        MessageBox.Show(exp.Message);
    }
}

Acquire an image from the video stream




//Acquire an image
private void btnAcquire_Click(object sender, EventArgs e)
{
    try
    {
        dynamicDotNetTwain1.EnableSource();
    }
    catch (Exception exp)
    {
        MessageBox.Show(exp.Message);
    }
}

Save the acquired images locally




Dynamic .NET TWAIN provides internal encoder for BMP, JPEG, PNG, (multi-page) TIF and (multi-page) PDF.

private void btnSave_Click(object sender, EventArgs e)
{
    SaveFileDialog saveFileDialog = new SaveFileDialog();
    saveFileDialog.FileName = "test.pdf";
    saveFileDialog.Filter = "pdf files (*.pdf)|*.pdf|All files (*.*)|*.*";
    if (saveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
    {
        dynamicDotNetTwain1.SaveAllAsPDF(saveFileDialog.FileName);
    }
}

Get Sample Code Now

To build your own webcam capture module using the SDK, download the 30-day free trial of Dynamic .NET TWAIN.

This artice was originally posted on CodeProject.

If you are interested in embedding webcam capture in a browser-based application, you may take a look at Dynamsoft Webcam SDK.

Published: By: Code Tutorial - January 25, 2023

Tuesday, 24 January 2023

How to install G++ the C++ compiler on Ubuntu 18.04 Bionic Beaver Linux


 

How to install G++ the C++ compiler on Ubuntu 18.04 Bionic Beaver Linux






Objective

The objective is to install G++ the C++ compiler on Ubuntu 18.04 Bionic Beaver

Operating System and Software Versions

  • Operating System: – Ubuntu 18.04 Bionic Beaver

Requirements

Privileged access to your Ubuntu System as root or via sudo command is required.

Conventions

  • # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Other Versions of this Tutorial

Ubuntu 20.04 (Focal Fossa)

Instructions

Install GCC

The following linux command will install gcc compiler on on Ubuntu 18.04 Bionic Beaver. Open up terminal and enter:

$ sudo apt install g++

Install build-essential

Another way to install g++ compiler is to install it as part of build-essential package. Additionally the build-essential package will also install additional libraries as well as gcc compiler. In most cases or if unsure this is exactly what you need:

$ sudo apt install build-essential


Check G++ version

Confirm your installation by checking for GCC version:

$ g++ --version
g++ (Ubuntu 7.2.0-18ubuntu2) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

C Hello World

Compile a simple C++ “Hello World” code:

#include <iostream>
using namespace std;

int main() 
{
    cout << "Hello, World!";
    return 0;
}

Save the above code within hello.cc file, compile and execute it:

$ g++ -o hello hello.cc 
$ ./hello 
Hello, World!
Published: By: Code Tutorial - January 24, 2023

Installing the Mac C++ Compiler

 

Installing the Mac C++ Compiler

This document will help you download and install clang, the Mac C++ compiler.
  1. Open a Terminal window. (This can be done by clicking the magnifying glass in the upper-right part of the menu bar [Spotlight] and typing the word "terminal" in the box that appears. Press enter, and the Terminal window will open.)

  2. Enter the command xcode-select --install (or you can cut and paste it from here) and press enter. The following pop-up window should appear on your screen.

    If instead you see the message "xcode-select: error: command line tools are already installed, use "Software Update" to install updates," then open the App Store and check to see if there are any software updates available for Xcode. If not, then you're all done, and you can proceed to the directions for installing CLion.

  3. Click "Install." The license agreement window will appear. Click "Agree." After the software is installed, you will see a message telling you so.

  4. Click "Done."

  5. At this point the clang C++ compiler is installed. If you want to double check, in the Terminal window, you can type the command clang --version to make sure. The output should look something like this:


Published: By: Code Tutorial - January 24, 2023

How to Download and Install C++ IDE on Windows

 

What is Dev-C++?

Dev-C++, developed by Bloodshed Software, is a fully-featured graphical IDE (Integrated Development Environment) for C and C++ programming. It is distributed under the GNU General Public License for programming in C and C++.

How to Download and Install Dev C++ on Windows

There are many compilers available for C++ programming. You can download anyone. Here, we are going to use Dev C++. It will work for both C++ and C programming languages.


To install Dev C++ software, you need to follow the following steps.

Step 1) First you must download the Dev C++ on your Windows machine. Visit to Download Dev C++: http://www.bloodshed.net/


Step 2) There are packages for different Operating Systems.



Step 3) Under package Dev-C++ 5.0 (4.9.9.2) with Mingw/GCC 3.4.2 compiler and GDB 5.2.1 debugger (9.0 MB) Click on the link “Download from SourceForge”.



Step 4) This package will download C++ .exe file for Windows that can be used to install on Windows 7/8/XP/Vista/10.



Step 5) You will direct to SourceForge website, and your C++ download will start automatically.

  • Click on save button to save. By default, it is saved in “Downloads” folder.
  • After the download completes, go to the saved .exe file and click on it to Run.
  • The installer will ask you a language to select. Select “English” and click on “OK”.




  • Then screen for license agreement will appear. Click on “I agree” to proceed further.




Step 6) In this step,


  1. You can see different components of Dev C++ that will be installed with this package.
  2. Just click on “next” button.



Step 7) In this step,


  1. By default, the destination folder is in C drive. You are free to change this destination folder but make sure you have enough memory.
  2. Click on “Install” button.




In the next screen, installation begins




Now, Dev C++ is installed successfully on your Windows. Select ” Run Dev C++” to run it and click on ” Finish” button.





That’s it! Now you are ready to compile your C or C++ programs with Dev C++ compiler.

Published: By: Code Tutorial - January 24, 2023