Solved

how can i find the .net framework version in my windows xp ???

Posted on 2011-02-24
6
517 Views
Last Modified: 2012-05-11
currently i am working on C#.net windows application ...

i want to know that how can i find the current .net framework version in my windows xp ???

is there any command for that ??
0
Comment
Question by:Parth48
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 14

Expert Comment

by:quizwedge
ID: 34969124
0
 
LVL 13

Expert Comment

by:agarwalrahul
ID: 34969147
Go to the Control Panel-> Click on Add Remove Programs-> Check Microsoft .Net Framework version or go to the Framework Folder, Path=C:\WINDOWS\Microsoft.NET\Framework, their are separate folder for each .Net Framework.

Like: You Find v1.0.3705, v1.1.4322, v2.0.50727 means you have upto .Net Framework 2.0.
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 34969553
I have this code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Text.RegularExpressions;

namespace WindowsApplication1
{
    public partial class Form1 : Form
    {

        private const string FRAMEWORK_PATH = "\\Microsoft.NET\\Framework";
        private const string WINDIR1 = "windir";
        private const string WINDIR2 = "SystemRoot";

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show(AllFrameworkVersions);
        }

        public string WindowsPath
        {
            get
            {
                string strWinDir = Environment.GetEnvironmentVariable(WINDIR1);
                if (string.IsNullOrEmpty(strWinDir))
                {
                    strWinDir = Environment.GetEnvironmentVariable(WINDIR2);
                }

                return strWinDir;
            }
        }

        public string NetFrameworkInstallationPath
        {
            get { return WindowsPath + FRAMEWORK_PATH; }
        }

        public string AllFrameworkVersions
        {
            get
            {
                string strInfo = string.Empty;
                string strVersion = "Unknown";

                foreach (string strX in Directory.GetDirectories(NetFrameworkInstallationPath, "v*"))
                {
                    strVersion = ExtractVersion(strX);
                    if (PatternIsVersion(strVersion))
                    {
                        if (!string.IsNullOrEmpty(strInfo))
                            strInfo += ", ";
                        strInfo += strVersion;
                    }
                }

                return strInfo;
            }
        }

        private string ExtractVersion(string pdirectory)
        {
            int intStartIndex = pdirectory.LastIndexOf("\\") + 2;
            return pdirectory.Substring(intStartIndex, pdirectory.Length - intStartIndex);
        }

        private bool PatternIsVersion(string pVersion)
        {
            return new Regex("[0-9](.[0-9]){0,3}").IsMatch(pVersion);
        }


    }
}

Open in new window

0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:Parth48
ID: 34977344
Thanks @emoreau:

it's worked...

i have to use only .net framework V4.0 , then what can i do ??

is there any setting in visual studio 2008 ??
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 34978436
Visual Studio 2008 cannot target .net framework 4.0 (only VS2010 can).

VS2008 can target 2.0, 3.0 or 3.5.

You have to either install .net frameork 2.0 and 3.5 to continue using VS2008 or use VS2010.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 34978469
Apparently you have created a new question (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_26847072.html) to contiue to work on this.

Since I have answered this question (how can i find the .net framework version in my windows xp), can you close this one?
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question