Posts tagged "Internet"

Checking if User is connected to Internet or Not using Win32 API and C# | Win32 API and C#


In application like Messenger or Application that provides automatic update need to check that user is connected to internet or not before proceeding further.


so we need to check whether  he is connected to internet or not we can check that with use of WIN32 API.


we can use Win32 API Wininet.dll ’sInternetGetConnectedState() method to check Internet Status 


for working with Pinvoke we need to add name space 


using System.Runtime.InteropServices;


now we need to write prototyping of the function  like below

[DllImport("wininet.dll")]

private extern static bool InternetGetConnectedState(outint connectionDescription, int reservedValue);

Now simply we can use this function to check internet connectivity 

take one button and label on form In buttons’s click even write following code 

private void btnCheckConnection_Click(objectsender, EventArgs e)

        {

            int Description=0;

            bool isConnected = InternetGetConnectedState(out Description, 0);

            if (isConnected == true)

            {

                label1.Text = ”User is Connected to Internet “;

            }

            else

            {

                label1.Text = ”Disconnected”;

            }

        }

Here is how complete code look like 

———————————————–

public partial class Form1 : Form

    {

        [DllImport("wininet.dll")]

        private extern static bool InternetGetConnectedState(out int connectionDescription,int reservedValue);

        public Form1()

        {

            InitializeComponent();

        }

        private void btnCheckConnection_Click(object sender, EventArgs e)

        {

            int Description=0;

            bool isConnected = InternetGetConnectedState(out Description, 0);

            if (isConnected == true)

            {

                label1.Text = ”User is Connected to Internet “;

            }

            else

            {

                label1.Text = ”Disconnected”;

            }

        }

    }

Thank you.


View the original article here



Be the first to comment - What do you think?
Posted by Anand Narayanaswamy - August 23, 2010 at 8:20 pm

Categories: C#   Tags: Checking, connected, download different Types Of Compilers in C#, Internet, sample DragLeave in c#, silverlight shared whiteboard, Using, Win32

5 Reasons Why Blogging is the New Internet Marketing Tool

Blogging is a concept that started in late 90s. It used to be a way to comment an existing webpage, an opportunity for visitors and readers to react or voice out one’s opinion on the said page. What started as a single-sentence commentary has evolved into pages of personal take on just about anything and everything under the sun. As it continues to move forward, online advertising has tapped into the blog’s potential. Here are 5 reasons why you should use blogging as an Internet marketing tool.

1.Blogging is simple. The simplest way to get your piece on the net is through blogging. No skills are necessary… an average adult can read and type, or at least click a mouse. It’s like having a virtual piece of paper and you just write your ideas, experiences, new products, and hope that the truth behind your articles comes out and entice your reader to also try your product. If you have a PC and an Internet connection (who doesn’t?) then you can blog and advertise.

2. Blogging is authentic. In this day and age where advertising saturate our lives, we question the credibility of promoters’ claims. However, in blogs, real people share their real-life experiences, unscathed by paid advertising. Reading blogs about first-hand product use is like talking to people about their first-hand experience. You definitely want to buy a tried and tested product.

3. Blogging is free. Because blogging is yet to be proven as a mainstream online advertising media, most sites see it as something to augment current marketing tools and thus offer it for free. Any opportunity for free webtime is definitely a bonus especially to businesses that are starting up. Needless to say, paid blog pages can generate more income for your seriously growing business.

4. Blogging builds credibility. As you get more and more into writing your experiences on a particular product or industry, your readers come to realize that they can depend on your posts for their own information needs. As such, you become an expert on it; as a consequence, more readers visit your site and more bloggers link to your blogs. As companies and professional organizations notice the growth of your readership base, they may soon get in touch with you for advertising on your blog page, or make you an affiliate, which pays for every referral generated from your blog site.

5. Blogging builds your market. Unless you are a Hollywood star, chances are, only your Mom reads your posts. Mom has a lot of friends, so she lets her friends know how interesting your blog site is. But you need not depend on Mom to increase your readership base. Look into the following ways to build your market through blogging:

-By using your e-mail. Today, blogging is overcoming the e-mail’s popularity in quickly and effectively reaching and expanding a market. In this age of speed and quick access, logging in and downloading e-mail is simply taking longer than clicking into a blog site. Let them explore your site by using a short e-mail message as teaser to your blog site. If your e-mail is on an entirely different subject, use your e-mail signature to give a link to the site.

-By using subscription. An easy way to get your readers e-mail is to give them an opportunity to subscribe to your blogsite. Keep some exclusive information for your subscribers to entice readers to subscribe and give their e-mail address. Just be responsible in using their e-mail address, as the last thing you want is a comment on your blog that you are a spammer.

-By understanding your readers. Conduct a simple survey for your readers to understand their profile and advertising preferences. Ask consumers to give you feedback on a post, an ad link, or a trial that you shared. In this way, it is like interviewing your readers without the commitment and intrusion of a face-to-face interview.

-By joining a blog network –A network of blogs maybe a collection of blog sites that share the same industry, interest, readership base, payment mode, etc. Consumers find credibility and convenience in clicking one link to several real bloggers about a single subject. Clearly, more bloggers are better than one.

-By using RSS. RSS is the fastest growing technology on the Internet today. As such, having RSS feeds to your blog is definitely another means of generating awareness for your readership base. Having a variety of feeds can add interest to your blog site.

Give your business a boost by effectively using blogging as an Internet marketing tool.

Be the first to comment - What do you think?
Posted by Anand Narayanaswamy - April 5, 2010 at 6:40 pm

Categories: Internet   Tags: blogging, Internet, Marketing, Reasons

Learn more about E-mail

This article provides answers to frequently asked questions regarding the usage of email.

Read more…

16 comments - What do you think?
Posted by Anand Narayanaswamy - January 8, 2009 at 7:00 am

Categories: Internet Tutorials   Tags: email, Internet

Learn more about Internet

This article provides answers to frequently asked questions regarding the usage of Internet.

Read more…

Be the first to comment - What do you think?
Posted by Anand Narayanaswamy - January 8, 2009 at 6:17 am

Categories: Internet Tutorials   Tags: Internet, isp