Sunday, October 28, 2012

How to allow user to Run only specific Application in Windows 7

If you are a System Administrator of a Company and as your Company standard user can run only specified Application which is authorized, then your task is How to allow user to run Only Specified Application such as MS word , Internet Explorer , MS Excel and Notepad etc.

Please follow the following step to do this :


  • Open Group Policy Editor by typing "gpedit" in start menu's search bar as same as displaying in following image.
  • Following screen is appeared.

  • In the above screen select the option in following way..
    • Select User Configuration
    • Select Administrative Templates
    • Select System 
  • In System option select "Run only specified Windows Application" as shown in following screen.

  • Now in opened screen select "Enabled" Radio buttion and click on "Show" button as displaying in following image.



  • Now new screen is displayed in that write the list of application's .exe file that you want to access to the user.

  • Some list of exe file name associated with application is as follow :
    • MS Word                 -      winword.exe
    • MS Excel                 -      excel.exe
    • Notepad                  -      notepad.exe
    • Internet Explorer   -      iexplore.exe
    • Calculator               -       calc.exe
    • Visual Studio         -       devenv.exe
  • After specify the list of exe file in the above screen click on OK button and then Apply button and then OK button.
  • Now, If user is going to access other than specified application it will give error message as following.

Wednesday, October 3, 2012

Android Code for calling .NET web service

You need to declare 4 variable to call web service method
  • OPERATION_NAME - name of method to call
  • NAMESPACE - namespace
  • SOAP_ACTION - particular methdo of specified namespace
  • URL - URL of your web serivce

Declare above variable as below :
  • String OPERATION_NAME="HelloWorld";
  • String NAMESPACE="www.tempuri.org/";
  • String SOAP_ACTION=NAMESPACE+OPERATION_NAME;
  • String URL="http://your-ip-address/your-application-nm(in .net)/Service.asmx"; ***

Note ***:  in above statement instead your-ip-address you have to write your own local pc ip address. you can find it from command prompt to invoke the ipconfig command. and specify your-application-nm which you specify at the time of making .NET web service.

Code to call HellowWorld method. (Default Method)

try{
   
      SoapObject request = new SoapObject(NAMESPACE,OPERATION_NAME);

      //below statement passes argument to the web method specify in web service.
      request.addProperty("name", "How r u?");   **

      SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
      envelope.dotNet=true;
      envelope.setOutputSoapObject(request);
      HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
      androidHttpTransport.call(SOAP_ACTION, envelope);
      Object result = (Object)envelope.getResponse();
      status=result.toString();
      Toast.makeText(getBaseContext(),status,Toast.LENGTH-LONG).show();
}
catch(Exception e)
{
      Toast.makeText(getBaseContext(), e.toString(), Toast.LENGTH_LONG).show();
}

NOTE ** : in this statement as first argument is as same as the name of the method argument you specified in .net and second argument the value of the argument.


Output :  HelloWorld How r u?
Explanation : HelloWorld from the method itself and second word which we pass from the ** statement.

Tutorial of Android Web Service Application with VB .Net

Hello Friends,

Today I am going to discuss with you that how to make web service in .NET and how to call it from android.

You need following tools to develop application.
  • Microsoft Visual Studio 2008 (to develop web methods)
  • Internet Infomation Service (IIS 6 for Windows XP and IIS 7.5 for Win7) (virtual server)
  • Android SDK (Min API Level-7) (to call web methods)
  • Eclipse HELIOS
  • KSOAP-android-2.5.2 jar file (it's a java class file which your have to include in your code.

Step 1 : You need  Microsoft Visual Studio 2008 to develop web-service method. You can download it from here.

Step 2: You can download IIS 7.5 from here.

Step 3: You can download android SDK from here.

Step 4: You can download Eclipse HELIOS from here.

Step 5: You can download KSOAP 2.5.2 jar file from this link

You have to explicitly add external libraries in your project by following step :

Right click on your project and select properties and click on Java Build Path -> Libries(Tab) -> Add External JARs.. (Button) and specify you KSOAP 2.5.2 file path.

Note : You need Dot Net Framework 3.5 to run IIServer on your local computer. You can externally download and install it from here.

Install all above softwares on your local computer and integrate your eclipse with android SDK.

You can show step to create web method from this link.

Step to call web service from android is mentioned in this link.

Monday, October 1, 2012

How to Create Web Service in Microsoft Visual Studio 2008 in Windows7

Here I am going to explain you how to develop web service in Microsoft Visual Studio 2008.

You need Internet Infomation Server (IIS) 7.5 as virtual server to run the web service.

You can download IIS 7.5 from here.
You need Dot Net Framework 3.5 to install IIS 7.5 You can download it from this link.

Now to configure IIS you have to go in control panel - > Programs and Features -> Turn Windows Features on or off.

Click on  Turn Windows Features on or off.

Now check 2 check box listed below :

  • Internet Information Service
  • Internet Information Service Hostable Web Core
Now Click on OK button and Restart your computer.

Now, You can check whether your web server works properly or not by following step :
  • Open your web browser and type localhost
  • If it successfully show you IIS 7 page then your web service will work properly otherwise something goes wrong.
Now Time to implement web method. To develop web method you need to open Microsoft Visual Studio 2008 in Administrative mode. You can right click on Microsoft Visual Studio 2008 and click on Run as Administrator. It will open IDE of Microsoft Visual Studio in Administrator mode.

Now to develop new web-service follow the following steps :

  1. You have to create new project so that go to File Menu -> New -> Website
  2. Select ASP.NET Web Service in Template.
  3. Now following window will be appear.

    3.  Now select HTTP in Location Option form Drop Down box because our method is resides on server and provide name of your web-service in following format : http://localhost/your-application-name.
    4.  Now select Visual Basic in Language Option because here I am going to explain code in VB,
    5.  Now click on Ok button.
    6.  By Default one method named HelloWorld will be created and it will return HelloWorld while one can invoke it.
    7. Define your own method and specify your logic.
    8. Do not forget write <WebMethod()> _  at every beginning of  method because it defines that this method is web method and called by application. If your not specify <WebMethod()> _  then that method will be used as private/local method.
    9. Now your web method will be define successfully.

You can manually run your web service from browser by written as follow :

http://localhost/your-application-name/Service.asmx


Android Code for calling web service method click on this link