XAML browser applications (XBAPs) combines features of both Web applications and rich-client applications. Like Web applications, XBAPs can be deployed to a Web server and started from Internet Explorer or Firefox.
Create an HTML page that contains a hyperlink to open the deployment manifest, which is the file that has the .xbap extension.


<html> 
  <head></head>
  <body> 
    <a href="WpfBrowserApplication1.xbap">Click this link to launch the application</a>
  </body> 
</html>

In Visual Studio, open the project properties.

On the Security tab, click Advanced.

The Advanced Security Settings dialog box appears.

Make sure that the Grant the application access to its site of origin check box is checked and then click OK.


On the Debug tab, select the Start browser with URL option and specify the URL for the HTML page that contains the XBAP.


In Internet Explorer, click the Tools button and then select Internet Options.

The Internet Options dialog box appears.

Click the Advanced tab.

In the Settings list under Security, check the Allow active content to run in files on My Computer check box.




Click OK.
Permalink 1 comments







First Download the latest version of BlogEngine from following URL
http://blogengine.codeplex.com/

by defualt BlogEngine is using XmlBlogProvider. therefore all data is saved in APP_DATA in XML files.

to change it to SQL Server follow the instructions:

create a Database in SQL Server 2005 or 2008.

Run the SQL script on you Database, the script is in this Folder:
BlogEngine.Web\setup\SQLServer\

Replace SQLServerWeb.config with Web.config

change the connection string in Web.config to your DB connection

change the blogProvider from XmlBlogProvider to DbBlogProvider

<BlogEngine>
<blogProvider defaultProvider="DbBlogProvider">
<providers>
 <add name="XmlBlogProvider" type="BlogEngine.Core.Providers.XmlBlogProvider, BlogEngine.Core"/>
 <add name="DbBlogProvider" type="BlogEngine.Core.Providers.DbBlogProvider, BlogEngine.Core" connectionStringName="BlogEngine"/>
</providers>
</blogProvider>
</BlogEngine>


The appliction should be runnable now.

PS: for importing Post you can use
bin/BlogImporter.asmx
call the service with WCF TestClient
Permalink 0 comments
SQL Server Profiler shows how SQL Server resolves queries internally. on Microsoft SQL Server Management Studio on Menus Tools-> SQL Server Profiler.



as you can see the log file generated is too big to track. by adding Application Name to ConnectionString , you can filter the Log file:



server=MyServer;database=MyDatabase;Integrated Security=SSPI;Application Name=My Application;

Permalink 0 comments
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime;
using System.Runtime.CompilerServices;
using System.Security;
using System.Text;

public class MainClass
{
    public static void Main()
    {
        Thread paramThread = new Thread(ParameterizedFunction);
        paramThread.Start("Test");

        paramThread.Join();
    }
    private static void ParameterizedFunction(string o)
    {
        Console.WriteLine("Param worker: {0}", o);
    }
}
Permalink 0 comments
Sometimes you need to do two different task and you want that the task do simultaneously or one task wait for other task to finish.

in the following example , there are three different Thread and when you join the Thread they will wait until all joined thread finished.

using System;
using System.Threading;

class MyThread
{
    public int count;
    public Thread thrd;
    public MyThread(string name)
    {
        count = 0;
        thrd = new Thread(this.run);
        thrd.Name = name;
        thrd.Start();
    }
    void run()
    {
        Console.WriteLine(thrd.Name + " starting.");
        do
        {
            Thread.Sleep(500);
            Console.WriteLine("In " + thrd.Name +
                              ", count is " + count);
            count++;
        } while (count < 10);

        Console.WriteLine(thrd.Name + " terminating.");
    }
}
class MainClass
{
    public static void Main()
    {
        Console.WriteLine("Main thread starting.");

        MyThread mt1 = new MyThread("Child #1");
        MyThread mt2 = new MyThread("Child #2");
        MyThread mt3 = new MyThread("Child #3");

        mt1.thrd.Join();
        Console.WriteLine("Child #1 joined.");

        mt2.thrd.Join();
        Console.WriteLine("Child #2 joined.");

        mt3.thrd.Join();
        Console.WriteLine("Child #3 joined.");
        
        ThreadStart mythred = new ThreadStart(test);
        Thread t = new Thread(mythred);
        t.Start();
        t.Join();

        Console.WriteLine("Main thread ending.");
    }

    private static void test()
    {
        Thread.Sleep(3000); 
        Console.WriteLine("My thread finished");
    }
}


for more information you can check here
Permalink 0 comments