jeudi 3 mars 2011

The .Net Framework next Version 4.5

In your opinion, what new features will be on The .Net Framework next Version 4.5 ? personally, i think that .net team will implement a new TYpe Called "ANY", that means Any type.
For example:
Any any = new Any();
any=5 ;
any=Datetime.Now;
any= new List();


But the difference between this Type and "Var" or "Dynamic",is that on developpement time (on VS editor),the any object will change it type, depending on the affected value, and you can use it on "Class" definition. i mean if i set an Int value on any object, the intellicense will change for int object.
so i can use my Any object like int.
any=5 ;
int x = any.Parse("6");



thx,
Mehdi.

lundi 21 juin 2010

El-Mehdi KADAOUI – « Code Project Associate », très présent sur le web et contributeur NTIC actif

Bonjour,

C'est avec une grande joie, que j'ai lu mon profil sur "emaroc.info", bien que je connais son propriétaire M Alaa-eddine, ça reste un honneur pour moi.
Merci "emaroc" ;)

El-Mehdi KADAOUI – « Code Project Associate », très présent sur le web et contributeur NTIC actif

mardi 30 mars 2010

Microsoft TechDays 2010 Belgium - 30-31 March & 1 April in Metropolis, Antwerp

Developers and IT professionals gather at the Microsoft TechDays conference to get the latest in-depth technical information on the current and near future Microsoft platform.


vendredi 26 février 2010

[Video] How To Develop & Deploy a Web Role (Asp.net) application in Windows Azure

Hello Monug People,

Here you will find 3 parts of Tutoriel videos that i have made,

about "How Develop & Deploy a Web Role (Asp.net) application in Windows Azure"

It's in French!

Part 1:


Part 2:


Part 3:

vendredi 19 février 2010

Live Mesh


Hello, Do you know Live Mesh ?!

Live Mesh is a tool that lets you synchronize your data (documents, images,
videos, ...) between your computers, share them with members of your
social graph, and finally of "access to the data from n" anywhere at
any time through the concept of Live Desktop that you are making available



Try it:
Live Mesh


Best regards
Mehdi

First Steps into Windows AZURE



Hello ,

Recentlly, I readed some articles about Windows AZURE and how it works,
so i decided to create a simple "HELLO" Cloud project.

Try it: Monug Cloud Project



Best regards,
Kadaoui El Mehdi.

vendredi 5 février 2010

CallBack Web Controls article @ www.asp.net


Hello people,

My Recent Article "The CallBack web Controls" is now live @ www.asp.net, Great!

vendredi 8 janvier 2010

Morocco .Net User Group (MONUG)




The First .Net Moroccan Comunity Group on FaceBook
Morocco .Net User Group (MONUG)

My First Project @ CodePlex.com

CallBack Webcontrols @ CodePlex.com


Project Activity

Page Views: 378
Visits : 202
Downloads : 40


Not bad for the first week!

mercredi 6 janvier 2010

CallBack WebControls

Introduction

In this article, I present another aspect of communication in the Asp. Net 2.0, named "CallBack” and how it can be used for a web application asp.net soft light and especially preformative.


For this I created a set of "WebControls" based on the "CallBack" not on "PostBack" but that works exactly like the standard controls of Asp.net 2.0


I will first start by explaining important concepts for understanding the article and finally I'll show you an example in practice

CallBack ?

The Callback is among the novelties of the ASP. Net 2.0, it can communicate with the server without posting the whole page ..

The difference between Callback and postback is that in the PostBack whenever you click a button, all the HTML of the page and its controls is regenerated (Render).
By cons in the callback is not the case and it is very important! Why regenerate all the HTML page? Is it important to do? when I just want to add a row in my GridView (for example).

So for a web application slightly, the "Render" of a control should be targeted and not overall ..

I mean no need to generate all the html code of the page and its controls.

You can use "Ajax control" but I do not know the code generated behind, so I can control what happens in my application.

To better understand this we will see the page life cycle with 2 modes (PostBack and CallBack)....

Continue the Article at CodeProject.com

Source Code at CodePlex.com


mercredi 16 décembre 2009

Asp.net 2.0: ListControl Vs WebControl when (Page.IsCallback == True)

Hi,
In Asp.net 2.0 :

- you can catch asynch Event on implementing ICallBackEvent Handler.
- the Event LoadViewState is raised after a POSTPACK

So if you create 2 Custom web controls ( "WC1" and "WC2"):

-WC1: inherits from "WebControl" and implements " ICallBackEvent Handler"

-WC2: inherits from "ListControl" and implements " ICallBackEvent Handler"

-override the LoadViewstate in the 2 controls and put a breakpoints.

On the click event of WC1, you call a Javascript Method that send a Callback to the Server


Normally When you click on WC1, the LoadViewState event will be not raised because is not a POSTBACK event, BUT strangelly in the WC2 the LoadViewState method is raised!

So the conclusion is, All controls that inherits from "ListControl" raise the LoadViewState method evenif there is no postback!

WHY ?

dimanche 27 septembre 2009

"Code Project Associate" Status @ Code Project


Now i'm "The Code Project Associate" @ THE CODE PROJECT, Thanks all.

Code Project Member Types:

The Code Project Associate

Members who have their own websites with their high quality content and who choose to share their content with The Code Project community can be selected to be Code Project Associates.



vendredi 25 septembre 2009

Asp.Net : __VIEWSTATE Bug !

When you Try this on Asp.net 2.0 WebSite:

http://www.YouWebsite/default.aspx?__VIEWSTATE=COUCOU!

You will have something like that:



How can we exploit it ? and what we have to do, to resolve this Bug?!

Any Suggestions Are Welcome.


08/01/2010

I found the Solution: Remove "__VIEWSTATE" parameter From "Request.QueryString"

protected override void OnInitComplete(EventArgs e)
{
base.OnInitComplete(e);

if (Request.QueryString.ToString().Contains("__VIEWSTATE"))
{

// reflect to readonly property
PropertyInfo isreadonly = typeof(System.Collections.Specialized.NameValueCollection).GetProperty("IsReadOnly", BindingFlags.Instance | BindingFlags.NonPublic);

// make collection editable
isreadonly.SetValue(this.Request.QueryString, false, null);

// remove
this.Request.QueryString.Remove("__VIEWSTATE");


// make collection readonly again
isreadonly.SetValue(this.Request.QueryString, true, null);

}

}

lundi 9 mars 2009

Microsoft TechDays in Belgium, 10-12 March 2009


During 3 days, in 60 technical sessions, you’ll get a deep-dive on existing and future technologies of Microsoft:
  • Discoveries: Windows 7, Windows Azure, Cloud Computing, C# 4.0
  • Architecture and development: Visual Studio, Silverlight, SharePoint, web applications, …
  • Infrastructure and enterprise applications: SQL Server, WCF, Windows Server, virtualization, System Center, security, …
  • Personal and collective efficiency: Data access, desktop management, Unified Communications, remote office operations, SharePoint,…

But also:

  • Get your hands on a Microsoft Surface
  • Interact with the Microsoft partner network and the Microsoft linked applications and services
  • Discover our certification offerings
  • Share impressions with your peers and meet with internationally renowned professionals

vendredi 6 mars 2009

How to protect C# program from .Net Decompiler ?!

Hi,
As you know there is some .Net Decompiler as Reflector that allows getting .Net DLL Source Code!

Do you think it’s a real threat for all .Net Programs?! Or maybe the first Microsoft steps in the Open source world? Or a bad news for Microsoft because they did not expect that?

I found on the web some tools to protect C# programs…but they could affect the performance of the original program.

lundi 16 février 2009

what year was released C# language ?

I know that the C# language was released in 2001 but look at the header of the class "System.Web.UI.Page" code source:

//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//

//-----------------------------------------------------------------------------

// Uncomment out this line to display rare field statistics at the end of the page
//#define DISPLAYRAREFIELDSTATISTICS

/*
* Page class definition
*
* Copyright (c) 1998 Microsoft Corporation
*/

namespace System.Web.UI {

then 2001 or 1998??

vendredi 13 février 2009

Asp.Net Compilation: Generate C# Class file from "Aspx" Page

As you know, ASP.NET Works like This:



the Default.aspx page and is Code behind class Default.aspx.cs are compiled into One Class! because in page directives (the first line in Default.apsx) you find something like that:

1: CodeBehind="Default.aspx.cs" Inherits="AspxToCsharp._Default"

that means: "Default.aspx" page Inherits from "_Default.cs" C# Class

But how it's possible ?! Default.aspx it's a page that contain HTML & Script CODE!

How Asp.Net Do to Transform Default.aspx page to Default_aspx C# Class ?

I will show you ;)

Practice

+Create a simple web Project that contains one page "Default.aspx" :



+Run Web project (F5).

+Go to:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root


you will find 2 directories, select a second one:


this Directory contains all Temporary files that asp.net Generate when Compiling Asp.net application!

we will focus on 2 C# class files:

  • App_Web_qtunxhs-.1.cs: The Factory Class of Default.apsx page
  • App_Web_qtunxhs-.0.cs (is the Main Part of this Article) : it represents the C# class generated from HTML&Script code on Default.aspx page, Open it on Visual Studio you will Find:
  1. Class Definition: As you see the Generated Class default_aspx inherits(1) from AspxToCsharp._Default
    public class default_aspx : global::AspxToCsharp._Default, System.Web.SessionState.IRequiresSessionState, System.Web.IHttpHandler {

    private static bool @__initialized;

    private static object @__fileDependencies;
  2. Constructor: set dependecies with Default.aspx page
  3. [System.Diagnostics.DebuggerNonUserCodeAttribute()]public default_aspx() {
    string[] dependencies;
    ((global::AspxToCsharp._Default)(this)).AppRelativeVirtualPath = "~/Default.aspx";
    if ((global::ASP.default_aspx.@__initialized == false)) {
    dependencies = new string[1];
    dependencies[0] = "~/Default.aspx";
    global::ASP.default_aspx.@__fileDependencies = this.GetWrappedFileDependencies(dependencies);
    global::ASP.default_aspx.@__initialized = true;
    }
    this.Server.ScriptTimeout = 30000000;
    }
  4. UI Methods (That Generate HTML Controls on Page):
  • Title
  1. HTML:
<title>Aspx To Csharp</title>

  1. C#:

  • Head
  1. HTML :

    <head runat="server">
    <title>Aspx To Csharp</title>
    <script type="text/javascript" >
    function toto()
    {
    alert('toto');
    }
    </script>
    </head>

  2. C#:

  • Input Button:
  1. HTML:
    <input id="Button2" type="button" value="button" onclick="Toto();"/>

  2. C#:

  • Asp.Net Button:
  1. HTML:
    <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />

  2. C#:

  • Form:
  1. HTML:
    <form id="form1" runat="server">
    <div>
    <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
    </div>
    <input id="Button2" type="button" value="button" onclick="Toto();"/>
    </form>
  2. C#:


  • Page(Default.aspx):
  1. HTML:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>Aspx To Csharp</title>
    <script type="text/javascript" >
    function toto()
    {
    alert('toto');
    }
    </script>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
    </div>
    <input id="Button2" type="button" value="button" onclick="Toto();"/>
    </form>
    </body>
    </html>

  2. C#:


Now you know How Asp.Net Transform "Default.apsx" page into C# Class "Default_aspx" for Comple it with is Code behind class "_Default" to generate WebApplication DLL.

Conclusion:
P.S: The WebApplication DLL (AspxToCsharp.dll) is instantiated for each client request!

dimanche 8 février 2009

How to Implement Something Like "AJAX" in your ASP.Net Page!

In .Net framework 2.0 and upper, there's some AJAX controls that you can "DRAG&DROP" to your ASP.Net page, to have a Asynchrone communication with server IIS.

But you don't know how they communicate! the "Asynchrone communication procces" it's hidden of you and you want Understand it!

I will show you ;)

Practice
+Create a Aspx Page like this:


-each time you write something in inputText the keyup Event raise a callBack to Server .

+ in Aspx Page Code behind:
  • Page_Load():
in Page_Load we register the Ajax client script to the client's browser and create a list of string (the source) that contains some names.
The Page must implement ICallbackEventHandler to Catch CallBack Event from Client!
  • ICallbackEventHandler
when implementing ICallbackEventHandler, two methods are added:
  • RaiseCallbackEvent: Catch a CallBack event from Client.
  • GetCallbackResult: return a CallBack result to Client.

Now your page is Fully Ajax => Run & Test!

An FTP secure client library for C#

The purpose of this article is to create a C # FTP client in Secure mode, so if you don’t have much knowledge of FTPS, I advise you to take a look at this: FTPS.

In the .NET Framework, to upload a file in FTPS mode, we generally use the FtpWebRequest class, but you can not send commands with « quote » arguments, and even if you search on the web, you will not find a concrete example of a secured C# FTP client.

It’s for those reasons I decided to create this article.

How to implement an FTP secure connection with an SSL stream class


Rechercher dans ce blog