Jan 25, 2011

Calling an exe from another application and passing an argument to it .Net

Calling an exe from another application and passing an argument to it .Net
Calling an exe from another application is always easy in .net.
You need to just add System.diagnostics namespace to your project and choose the properties.
Properties
ProcessStartInfo
Stores information about the process.
FileName
The program or filename you want to run. It can be a file such as "example.txt". It can be a program such as "WINWORD.EXE".
Arguments
Stores the arguments, such as -flags or filename.
CreateNoWindow Allows you to run a command line program silently. It does not flash a console window.
WindowStyle Use this to set windows as hidden.
ProcessWindowStyle.Hidden used often.
UserName WorkingDirectory
Domain These control OS-specific parameters.
For more complex situations, where Windows features are used.
Examples
using System.Diagnostics;
class Program
{
static void Main()
{
// Open the file "example.txt" that is in the same directory as
// your .exe file you are running.
// To call any other exe you need to just specify the path of the exe.
Process.Start("example.txt");
}
}
This example is to call an exe and pass the arguments.
using System.Diagnostics;
class Program
{
static void Main()
{
// A.
// Open specified Word file.
OpenMicrosoftWord(@"C:\Users\Sam\Documents\Gears.docx");
}
///
/// Open specified word document.
///
static void OpenMicrosoftWord(string f)
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "WINWORD.EXE";
startInfo.Arguments = f;
Process.Start(startInfo);
}
}
  

Jan 24, 2011

Exception: Failed to load the .Net framework / .net Application working fine in one system but not working in other system.


Failed to load the .Net framework


.net Application working fine in one system but not working in other system.

This exception occurs at times because of the mismatch path to the GAC [Global assembly cache] So failure to load the dlls in the GAC happens leading to an exception.
TO resolve the issue
You need to set the framework path in environment variables path as mentioned below, go to MyComputer-Properties--;Advanced-Environment Variables

In this click new button under system variables
and add the path of .net framework
example
C:\Program Files\Microsoft.NET\v3.5

Hope it helped u...
Cheers!!!!

WPF application getting struck in windows7/Xp




WPF application getting struck in windows 7/Xp
In windows you have a service that runs in background that stores the font that are used. So at times due to the overlap of the fonts and over storage of the same in Fontcache 3.0.0.0.dat file it leads in the balnk screen when you run the exe.
To resolve the issue follow the steps given below.
  1. Exit all WPF-based applications that are running on the computer.
  2. Stop the Windows Presentation Foundation Font Cache 3.0.0.0 service. To stop the Windows Presentation Foundation Font Cache 3.0.0.0 service, use one of the following methods.

    Method 1: Use Microsoft Management Console
    1. Click Start, click Run, type Services.msc, and then click OK.
    2. Right-click Windows Presentation Foundation Font Cache 3.0.0.0, and then click Stop.
    Method 2: Use the command prompt
    1. Click Start, click Run, type cmd, and then click OK.
    2. At the command prompt, type net stop "Windows Presentation Foundation Font Cache 3.0.0.0", and then press ENTER.
  3. Delete the old Fontcache3.0.0.0.dat file.

    Note By default, the Fontcache3.0.0.0.dat file is located in the %windir%\ServiceProfiles\LocalService\AppData\Local folder in Windows Vista. By default, the Fontcache3.0.0.0.dat file is located in the %systemdrive%\Documents and Settings\LocalService\Local Settings\Application Data folder in Windows XP and in earlier versions of Windows.
Hope this helped u....
CHEERS!!!!!


SANDEEP

Wcf application working fine in Xp but not working in windows7


Wcf application working fine in Xp but not working in windows7
In xp you not need to register your url [end point address] but in windows7 you need to register the url for someone to access the endpoint and its service.
To register the url you need to follow the steps mentioned below.
Step1: Run the command prompt as a administrator
Step2: Add ur url using the netsh tool
Example
In command prompt type this
Run command prompt as an administrator--> type this,
netsh http add urlacl url=http://Sandeep:8000/WcfService user=username

here the http://Sandeep:8000/WcfService is my end point address and username should be given the username of the system or the computer name if the username of the system does not work.

Hope that it helped U
CHEERS!!!!!

Apr 6, 2008

jus put in ur head !



Word of the Day






Dec 6, 2007

Study Abroad

Study Abroad for Grad Students
The National Science Foundation offers an opportunity for summer study abroad for graduate students in biological sciences, computer and information science and technology, STEM education, engineering, geosciences, math, plus social, behavioral or economic sciences. Apply by Dec. 12. See our calendar page for details.
Study Abroad is for Everybody!
Can you go abroad if you are in a technical major? If you don't speak any foreign languages? If you don't have a lot of extra money? Yes, you can!
Our office is dedicated to helping as many Purdue students as possible to have overseas experiences. We help you to overcome academic, financial, or personal concerns that might prevent you from going abroad and we're especially devoted to removing obstacles for first-time travelers. Begin your adventure today by exploring our searchable list of programs.
There will also be a series of Information Sessions for specific programs early this semester. For a list of scheduled information meetings, consult the Study Abroad calendar.
Passports required!
In the past, students could apply for Study Abroad, and then wait until finding out if they had been accepted before applying for a passport. This is no longer possible.
You now need to show the Study Abroad Office proof that you have a passport, or that you have applied for one, at the time you apply for one of our programs.
(* NOTE: This requirement is waived if you are applying for an International Programs In Agriculture [IPIA] program.)
Students who are even thinking of going abroad are strongly encouraged to apply for a passport as soon as possible!