Posted on

Mecdata – Website Development

MECDATA is an Italian company that offers a wide range of IT services, including website development and design. They have a team of experienced web developers who can create custom websites that meet the specific needs of their clients. MECDATA’s website development services include:

  • Website design and development: MECDATA can design and develop a website from scratch, or they can work with you to redesign an existing website.
  • E-commerce solutions: MECDATA can create an e-commerce website that allows you to sell your products or services online.
  • Content management systems (CMS): MECDATA can install and configure a CMS for your website, which will allow you to easily manage your website’s content.
  • Search engine optimization (SEO): MECDATA can help you optimize your website for search engines, so that it is more likely to be found by potential customers.
  • Website maintenance: MECDATA can provide ongoing maintenance for your website, so that it is always up-to-date and secure.

MECDATA’s website development services are affordable and reliable, and they have a strong track record of success. They are committed to providing their clients with high-quality websites that meet their specific needs.

If you are looking for a company to develop your website, MECDATA is a great option. They have the experience and expertise to create a website that will help you achieve your business goals.

Here are some of the reasons why you should choose MECDATA to develop your website:

  • Experience: MECDATA has a team of experienced web developers who have a proven track record of success.
  • Expertise: MECDATA has expertise in all aspects of website development, from design and development to SEO and maintenance.
  • Affordability: MECDATA’s website development services are affordable and competitive.
  • Reliability: MECDATA is a reliable company that is committed to providing its clients with high-quality websites.

Contact MECDATA today to get a free quote for your website development project.


Post written by Bart on 21/11/2023
Posted on

Retrieve resources in c# Windows Forms .Net Application

Scenario

You have a library (dll) with one or more image and you want to use those image in your application.

Load Resource from application

Consider having a library called : myLibrary.dll with some class inside with Namespace mylibrary.

In your bapplication you can get to the resources by referencing the assembly :

Assembly assem = Assembly.LoadFrom("myLibrary.dll");

You can enumerate the resource files

string[] resNames = assem.GetManifestResourceNames();
if (resNames.Length == 0)
Console.WriteLine(" No resources found.");

foreach (var resName in resNames)
Console.WriteLine(" Resource 1: {0}", resName.Replace(".resources", ""));
foreach (var resName in resNames)
Console.WriteLine(" Resource 2: {0}", resName);

And this will be the output :

Resource 1: myLibrary.Properties.Resources
Resource 2: myLibrary.Properties.Resources.resources

The replace is necessary because the real resource name is the first one (without .resources)

Now, If you have an image called myBitmap.png in your resources, you can load it, using ResourceManager

ResourceManager rm = new ResourceManager("myLibrary.Properties.Resources",
assem);

and finally

Object myres = rm.GetObject(myBitmap);

Load Resource inside Library

To get resource from a class inside your resource library, defined a new class, for example myClass and reference own assembly :

rm = new ResourceManager("myLibrary.Properties.Resources",
typeof(myClass).Assembly);

At this point you can withdraw the resource as seen above.

Posted on

Microsoft MFA : Enabled or Enforced

Multi Factor Authentication (MFA)

Microsoft recommends using multi factor authentication for global tenant administrators. If you don’t do this, 60 days after the last reminder from Microsoft, the tenant is deactivated.

Warning: it’s not enough to activate 2-factor authentication … you also have to use it.

Enabled or Enforced

The problem is that activation is not enough. In fact, after activating the user, he must also log in with the MFA: at this point the user’s status changes from Enabled to Enforced.

You don’t have to have Global Admin with MFA in Enabled status but only in Enforced status.

Posted on

Register a web application with Azure AD Portal App Registration to connect to a Microsoft 365 tenant

PowerShell Limits

Through Powershell it is possible to connect to a Microsoft 365 tenant to perform operations on users, groups and any other element of the tenant. When you use this tool, Powershell presents you with the mask for entering your account and password. You can write accounts and passwords directly in the Powershell script but it would be a serious security compromise.

Application

An alternative is to build a software that connects directly to the Tenant through customized keys present in the Tenant itself. In other words, it is necessary to communicate to the Tenant that there is a certain application that is authorized to access the Tenant. Furthermore, for each operation that you want to perform on the Tenant it is necessary to specify the appropriate permissions. To create these applications, we recommend that you follow the excellent tutorial “.Net Core console application for calling Microsoft Graph“.  This post proposes the images present in the previous tutorial only to specify how the application must be prepared on the Microsoft Tenant.

Register a web application with Azure AD Portal App Registration

Open a browser and navigate to the Azure Portal. Login using your account. Select the resource “Azure Active Directory”. On the left side menu, select “App regitstration”. Click New registration from the current page.

On the Register an application page, specify the following values:

  • Name = Name of your Application
  • Supported account types
  • Redirect URI
    • Type = Web
    • Value = https://localhost:8080   (*)

(*) The Redirect URI value must be unique within your domain. This value can be changed at a later time and does not need to point to a realy hosted URI.

It is now necessary to store 2 values that will be used in your application:

  • Application (client) ID
  • Directory (tenant) ID

Certificates & secrets

Click Certificates & secrets.

  1. Click New client secret.
  2. On the Add a client secret dialog, specify the following values:
    • Description = Your secret’s description
    • Expires = In 1 year (for example)
  3. Click Add.

After the screen has updated with the newly created client secret copy the VALUE of the client secret. This secret string is never shown again, so make sure you copy it now.

API permissions

Click API permissions.

  • Click Add a permission
  • On the Request API permissions panel select Microsoft Graph.

  • Select Application permissions.

Now you have to choose between the permissions to authorize your app. For example, to create an application to read alla information about Tenant’s users, in the “Select permissions” search box type “User”.Select User.Read.All from the filtered list. At the end, on the API permissions content blade, click Grant admin consent for the Tenant.

Summary of the data necessary for the application

Let’s see what data your application needs to connect and operate on the Microsoft Tenant.

  • applicationId = “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”;
  • applicationSecret = “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”;
  • tenantId = “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”;
  • redirectUri = “https://localhost:8080”;
  • domain = “yourtenant.onmicrosoft.com”;

Permissions

  • User.Read.All : Read all users’ full profiles
  • User.ReadWrite.All : Read and write all users’ full profiles
  • Group.ReadWrite.All : Read and write all groups
  • Notes.ReadWrite.All : Read and write all OneNote notebooks

Documentation