DirectoryComputersBlog Details for "Open Blog"

Open Blog

Open Blog
Open Blog for dot net programer and PHP developers and also web masters and Google Adsense
Articles: 1, 2, 3, 4, 5, 6, 7

Articles

How to check a valid IP Address
2007-12-23 15:49:00
Another idea to check an IP Address formatThe Code:'will make the text black if its a valid IP address'or red if its notPrivate Sub Text1_Change()Text1.ForeColor = 255If IsIP(Text1.Text) Then Text1.ForeColor = 0End Sub'place this part in a modulePublic Function IsIP(TestAddress As String) As BooleanDim IPt As StringDim TQ As LongDim TT As LongDim TW As LongDim IPTemp As LongIsIP = False 'Set return value as falseOn Error GoTo cockup'if an error occures the string is not validIf Left(TestAddress, 1) = "." Then Exit FunctionIf Right(TestAddress, 1) = "." Then Exit Function'check first and last are not "."For TQ = 1 To Len(TestAddress) 'test all charsIPt = Mid(TestAddress, TQ, 1)If IPt "." Then 'if its not a "." it must be 0-9If Asc(IPt) > 57 Or Asc(IPt) End IfNext TQTQ = InStr(1, TestAddress, ".", vbTextCompare) 'find the three dotsTT = InStr(TQ + 1, TestAddress, ".", vbTextCompare)TW = InStr(TT + 1, TestAddress, ".", vbTextCompare)If InStr(TW + 1, TestAddress, ".", ...
More About: Check , Vali
Read the Content of XML file into the DataSet
2007-12-23 15:39:00
This is the inverse of the last post!The code :Imports SystemImports System.DataImports System.Data.SqlClientPrivate Sub btnRead XMLData_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReadXMLData.Click Dim dsPubs As New DataSet() ' Read in XML from file dsPubs.ReadXml("Pubs.xml") ' Bind DataSet to Data Grid grdData.DataMember = "publishers" grdData.DataSource = dsPubsEnd SubHope it helps and good luck, any suggestion or questions post a comment !Omar Abid Blog
More About: File , Content , The Con
How to save a DataSet As XML File
2007-12-23 15:35:00
This is a cool idea to save a DataSet as XML file with VB.net, So far you can convert an SQL DataBase to XML format.The code :Private Sub btnWriteXMLData_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnWriteXMLData.Click Dim dsSales As New DataSet() Dim cn As New SqlConnection _ ("data source=localhost;initial catalog=pubs;user id=sa") Dim daAuthors As New SqlDataAdapter("select * from sales ", cn) Dim daPublishers As New SqlDataAdapter("select * from stores ", cn) ' Load data from database daAuthors.Fill(dsSales, "Sales") daPublishers.Fill(dsSales, "Stores") ' Write XML to file dsSales.WriteXml("XMLFile .xml")End SubHope it helps and good luck, any suggestion or questions post a comment !Omar Abid Blog
More About: Save
Create a CSV File with VB
2007-12-23 15:30:00
Hi friends,This is a method to create a CSV file with VB6.To make it with vb2005 just upgrade the code with the vb2005 toolThe Code :Dim nfile As IntegerDim conx as IntegerPrivate Sub cmdExport_Click()nfile = FreeFile ProgressBar1.Value = 1Open "filea" For Output As #nfileFor conx = 1 To nbr StatusBar1.Panels(1).Text = CInt(conx * 100 / nbr) & "% completed"'Print to file each field of the structure "Customer" Print #nfile, conx & ", " & Customer(conx).Field1 & ", " & Customer(conx).Field2 & ", " & Customer(conx).Field3 & ", " & Customer(conx).Field4 & ", " & Customer(conx).Field5 & ", " & Customer(conx).Field6 & ", " ProgressBar1.Value = conx * 100 / nbrNext conxClose #nfileFileCopy "filea", App.Path & "ExportedFile.csv"Kill "filea"If err.Number = 0 ThenMsgBox "File exported to working directory!"ElseMsgBox "Error exporting file: " & err.NumberEnd IfEnd Sub'The data structure has to be defined like this one...
More About: Create
Show/Hide the System Tray
2007-12-23 15:20:00
This a good and short code to show and hide the Windows Tray .It compatible with VB6 and also .netDeclaration :Private Declare Function Show Window Lib "user32" (ByVal hwnd As Long, _ ByVal nCmdShow As Long) As LongPrivate Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPrivate Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As LongPrivate Const Tray_SHOW = 5Private Const Tray_HIDE = 0Dim Trayhwnd As LongCode :Private Sub Form_Load()Trayhwnd = FindWindow("Shell_TrayWnd", "") Trayhwnd = FindWindowEx(Trayhwnd, 0, "TrayNotifyWnd", vbNullString) ShowWindow Trayhwnd, Tray_HIDE 'To Hide 'To show the System Tray add this code insteed of above 'ShowWindow Trayhwnd, Tray_SHOW 'To ShowEnd SubOmar Abid Blog
How to use text files with VB.net
2007-12-23 15:13:00
Hi there!This is a small tutorial on using files with VB.net.As VB.net uses new technologies it will be strange for some new developers!First we must import the Syste.IO ClassImports System.IOReading Text Files : the easiest way to open a text file is with the System.IO.File.OpenText() method. Code:'Dim your StreamReader Dim TextFileStream As System.IO.TextReader 'Load the textfile into the stream TextFileStream = System.IO.File.OpenText("C:MyTextFile.txt ") 'Read to the end of the file into a String variable. Dim MyFileContents As String = TextFileStream.ReadToEnd 'Close the Stream object TextFileStream.Close()The above code will open a text file on your C drive called MyTextFile.txt. It will load all of the text into a string variable called MyFileContents. It won't create a file of that name if it doesn't already exist (and will throw an exception which you should handle - but see later in the FAQ for how to create a new file). Creating Text Files: Code:'Dim your Text Write...
Solution for Base Conversion
2007-12-09 16:11:00
Option Explicit'Variables to hold Old Base Type and New Base TypePrivate OldBase As IntegerPrivate NewBase As Integer>In the form load:Private Sub Form_Load() 'Initialize Old and New Base Type to Decimal OldBase = 10 NewBase = 10End Sub>in the textbox named txtnumberPrivate Sub txtNumber_KeyPress(KeyAscii As Integer) 'If the key is NOT Backspace or Delete or Left or Right If KeyAscii vbKeyBack Then 'Determine the Base Type are we dealing with Select Case OldBase Case 2 'Only allow Binary numbers to be entered (0-1) If KeyAscii vbKey1 Then KeyAscii = 0 End If Case 8 'Only allow Octal numbers to be entered (0-7) If KeyAscii vbKey7 Then KeyAscii = 0 End If Case 10 'Only allow Decimal numbers to be entered (0-9) If KeyAscii vbKey9 Then KeyAs...
More About: Conversion , Solution
How to get the number of days in a month
2007-12-09 16:05:00
This is a good idea to get the number of days of any month'For current month...MsgBox DateAdd("m", 1, Now) - Now'For some other month (Example: June)Dim FirstDate As DateFirstDate = "01/06/2006"MsgBox DateAdd("m", 1, FirstDate) - FirstDateOmar Abid Blog
More About: Days , Month , Number , Mont
Another way to eject a CD
2007-12-09 16:04:00
This is another way to easily eject CD in only 5 line of code.Private Sub Form_Load()Call ejectEnd SubPublic Sub eject()'code to eject cdrom okDim owmp As ObjectDim colCDROMsSet owmp = CreateObject("WMPlayer.OCX.7")Set colCDROMs = owmp.cdromCollectionIf colCDROMs.Count >= 1 ThenFor i = 0 To colCDROMs.Count - 1colCDROMs.Item(i).ejectNextEnd IfEnd SubOmar Abid Blog
Search Text in a database
2007-12-09 15:58:00
This code will help you search any text in a database and show it in a datagridviewCreate a button named utOk, a text box named txtName and a datagrid named Datagrid1.Private Sub butOk_Click(ByValsender As System.Object, ByVal e As System.EventArgs) Handles but_ok.Click Dim strConnection As String = "Data Source=your SQL data source;Initial Catalog=your database; Integrated Security=True" Dim cn As SqlClient.SqlConnection = New SqlClient.SqlConnection(strConnection) Dim ds As New DataSet Dim strSelect As String 'strSelect As String strSelect = "SELECT * FROM " & YourTable & " WHERE [Search Field] = '" & Me.txtName.Text & "'" Dim dscmd As New SqlClient.SqlDataAdapter(strSelect, cn) dscmd.Fill(ds, "your table") Me.Datagrid1.DataSource = ds Me.Datagrid1.DataMember = "your table" Dim con As Integer con = Me.BindingContext(ds, "your table").Count If con = 0 Then MessageBox.Show("Recourd could not be found") End If End Sub...
More About: Database
How to Eject a CD or DVD
2007-12-09 15:56:00
This short code Snippet will help you eject a CD or DVD using Windows Media Player APIPublic Class frmEject 'you need window media player reference in your project '1 combo box ' 2 button control Dim omal As New WMPLib.WindowsMediaPlayer Dim total As Integer Dim i As Integer Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs ) Handles Me.FormClosing omal.close() End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load total = 0 i = 0 total = omal.cdromCollection.count If (total >= 1) Then For i = 0 To (total - 1) ComboBox1.Items.Add(omal.cdromCollection. Item(i).driveSpecifier) Next ComboBox1.Text = ComboBox1.Items.Item(0) End If MyBase.CenterToScreen() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) ...
Finding Maximum Value
2007-12-09 15:52:00
This code will show you how your going to find and display the maximum value in your array.'You will need a FORM and a command buttonOption ExplicitDim A(20), num, i, j, max As IntegerPrivate Sub Command1_Click()Print "Your array contains:"For i = 0 To num - 1 Print A(i)Next iPrint "Maximum Value= "; maxEnd SubPrivate Sub Form_Load()num = InputBox("Initialize your array [1-20]:")For i = 0 To num - 1 A(i) = InputBox("Enter your array:")Next i'find maximummax = A(0)For i = 0 To num - 1 If max max = A(i) End IfNextEnd SubOmar Abid Blog
Try Windows Live Space
2007-12-09 12:17:00
Good I'm Back AgainI had just tried out Windows Live Space . There you can make a home page very customizable and you can include many gadget. The thing that I loved is to include the blog summary or photo of my friends in MSN on the Blog. I liked it so much, plus you can include HTML and Script Text.Just have a look @ my space : http://omarabid.spaces.live.comOmar Abid Blog
More About: Windows Live
Exam Finished
2007-12-08 14:52:00
Yeah I've just finished school exams, but oof I didn't do well in this term.I know I have much since my lastet posts, but I think I have to start a new project.Now I don't have time, it's true that I have about 15 days of holiday, but I must also take care of my studies.And now happy holidays for all students.Omar Abid Blog
More About: Exam , Nish
The MSDN forum Tracker Blog
2007-11-17 17:55:00
Hi!I just strated the Msdn Forum Tracker Blog !What's that ?A very simple idea invented by me! This consist by getting best answered topics and posting them in the blog.How this will help you ?+You can subscribe to the feed burner and receive newest answered posts by email+You can browse on any topic and the solution is 100% found !Help us grow !Link to the blogComment the postsThe blog is here : www.msdntracker.blogspot.comOmar Abid Blog
Using Registry keys with VB.net
2007-11-13 13:35:00
Now we pass to an important part. How to use the registry keys (add, delete and modify) with VB.netFirst let's start: Create a new project, and add a button where you'll put the code.Open the registry editor to check that the changes are applied correctly.Now as you see there's keys (that are folder) an contain value.Let's start by making a key.This will make a key in the Current user root folder.My.Computer.Regis try .CurrentUser.C reateSubKey("TestKey")Now expand the The Current User root folder and you'll find a new key (folder) made!Lety set a value on it.My.Computer.Registry.SetValue("HKEY_CU RRENT_USERTestKey", _"TestValue", "This is a test value.")As you'll see a new "REG_SZ" value was added.Very Important : If you want to presice the registry key value type just type ',' and Visual Studio editor will list you the value types.Now let's read what we wrote!Dim readValue As StringreadValue = My.Computer.Registry.GetValue _("HKEY_CURRENT_USERTestKey", "TestValue", Nothing)...
More About: Keys
Introduction to Windows Registry Keys
2007-11-13 13:05:00
As you know Regis try Keys are quite important when you are programming an application to interact with the Windows Interface and properties.This a simple tutorial to show you how to use registry keys with VB.netYou can edit them manually using the Windows Registry Editor. To launch it, click on "execute" and type "Regedit"As you'll see there's a 5 different folders keys (root folder).HIVESThe Registry is split into a number of logical sections, or "hives". Hives are generally named by their Windows API definitions, which all begin "HKEY". They are abbreviated to a three- or four-letter short name starting with "HK" (e.g. HKCU and HKLM).The HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER nodes have a similar structure to each other; applications typically look up their settings by first checking for them in "HKEY_CURRENT_USERSoftwareVendor's nameApplication's nameVersionSetting name", and if the setting is not found looking instead in the same location under the HKEY_LOCAL_MACHINE ...
More About: Introduction
Google-Mini Dead
2007-11-10 20:12:00
Google-Mini is dead ? Try out Microsoft search engine express with advanced features and best of all : FREE ! http://www.microsoft.com/enterprisesearch /serverproducts/searchserverexpress/defau lt.aspxOmar Abid Blog
More About: Google , Dead
Alexa Ranking System
2007-11-10 20:03:00
Lots of you know Google Page Ranks for sure, but what about Alexa .First of all alexa don't rank pages but whole sites. Second if Google Page Rank is based on the pages that links to you, Alexa is based on the Traffic and this make it more real!Alexa compare traffic between sites and give top 500 sites, and also a search engine to search the top 100,000 sites.Then getting in top 100,000 is so hard? Yes so hard but why not getting linked in the Top 100,000 ?This is another thing but the thing that I liked most in Alexa is the real rankingFor example : number 1 is yahoo then 2 is google 3 is you tube 4 is live (ms) and 5 is MSN.With Alexa, you can know the sites that are linking to you and their rank. and now the rank help you more than Google PR because you know the site traffic and how much it can drive traffic to you;)Alexa.com visit it and give it a try !Omar Abid Blog
More About: System , Ranking , Stem
List of sites like Digg
2007-11-10 17:04:00
Ah Digg ! a good sites for us (( Says reader)) We find fresh informations!Ah Digg! a wonderfull site for us ((Says webmasters)) We get huge traffic throght it.AAA Says both we want sites alike DIGG.Ah Good, this is a list of sites like digg.Digg.com : Number 1 The most powerful, easy to use and drive most traffic to you.Fark.com : I didn't try it a lot but good trafficStumbleupon.com : yes but no so easy in navigationReddit.com : Okay it drives also traffic but you can't submit many urls a time! i-am-bored.com : need that admin accept linkisnare.com : you submit the whole article (few traffic)News.ycombinator.com : fast, easy and simple but small trafficthis is the list and I'll update it every day I found interesting site.If you know another site, post it in a comment and 10xOmar Abid Blog
More About: Sites , List
3 month of blogging and 300 $ in Google Adsense!
2007-11-10 15:50:00
Yes you see well I think! I have only 3 month of blogging with this blogger, but I have 300$ now on my account and that are increasing day by day!My earning reached 20 $ per day now and I have only 3 month!I'm not joking or just attracting attention, I speak seriously.How could I do this ?Posting Topic :Simple and easy, posts on anything you like (but interesting). Like Me, source code and example helpful for VB.net programers.Post a lot of topic and make a clear title for your post, that attract seekers.You'll need at least 50 topic to attract readers, but you can do them quicly.Digg with me !Google isn't very good for traffic, but for long. That mean Google direct to you a small traffic but every day.Digg drive to you huge traffic, but only the moment when you submit!So you have to make 5 posts per day and submit them to Digg. Interesting posts will attract lots of readers. Digg give me about 120 reader daily (if I submit) and 3 or 4 if i don't. But Google drive traffic consta...
More About: Adsense , Blogging , Google Adsense , Month
My first mail from Google Adsense
2007-11-10 15:49:00
Today 10 November, I received my first mail from Google Adsense , wait it isn't the check but the PIN code.I'm very happy and I entred it and all goes well and I'll receive my check the end of this month. Nice, no?What about you ? Post a comment! Omar Abid Blog
More About: Mail , Google Adsense
Another Way to get traffic and increase page rank
2007-11-10 10:29:00
OK, if we'll see all the sites want traffic and page ranks for it self! So don't run behind those sites "that increase page ranks of traffic", but just read reall interesting posts.I'm making those days, reasearch how other people have traffic. It's interestant to know. I see that many people post comments and add their link to the comment.Ah here it come! Suppose a person with PR 7 blog. And just posted a new topic (in the first page) and thousands of hits come. If you posts your link in a comment, you get small traffic of his traffic. But if you make an interesting post you'll get more and more and more until you say : "thanks god I don't need more".Let say this person have 1000 hits daily and you make the comment. If good comment you recieve at least 50 hits! and let say you posted 20 comments, then you'll receive 1000 hits! and more over page rank increase. 1000 hits ?! What do you want more.Sart commenting now! But first you must find the PR high blog, oh another difficu...
More About: Traffic , Page Rank , Page , Rank
How Google Adsense detects click fraud
2007-11-08 08:58:00
Many of webmasters wants to know how Google detects click frauds, perhaps to prevent from being banned. No one right now have the correct answer!. I had (with some of my friends) made two Adsense account and made the tests.Account Number 1:The site was accepted! We added the ads, and then I started my self by clicking on the ads. I was the only person that access to this site. So when seeing the Adsense reports, I see that the CTR level is high (80 %) due to the huge number of click and few impression (Ex : 50 impression and 35 clicks). After some days, Google prevent me from being banned. So Google won't delete your account from the first time, but it will inform you! I continue in click frauds and google disabled my account.Account Number 2:I have good traffic with this one because of my friends! We made a lot of traffic and page impression and few clicks (CTR = 5 or 8 %) Google Adsense Generate money. After some days we get an email alerting us from click frauds! (Note : We use ...
More About: Fraud , Click
Working Ads, Earning Money
2007-11-06 22:31:00
As I have a blog, then I must have a traffic because of numbers of posts, PR and other pages that links to me. Most of bloggers use Adsense to earn money from their blog. But I'm seeing in almost of blog only Adsense working. what about other ?. I make a small analytics. When you have a blog, where you made long and many posts, the page size (height) will be large! in the right or the left panel you won't have anything to display! As Adsense allow only 3 ads to display you can use others ad provider and earn more money.Let say you have added 3 other ad publisher then your earning will be 3 times more and also from different sources. For these reason I started to try Adbrite that I had seen in some sites. I just put it and the ads shows that I must wait 30 minutes until showing !!! But perhaps until it track the web site content.Any Way some days later I'll speak about the earning with Adbrite Vs AdsenseSuggestion, question ?? Post a commentOmar Abid Blog
More About: Money , Working , Earning , Workin
How Page Ranks Works !
2007-11-06 22:06:00
Page Rank, page rank and all web masters are talking about! What's this other thing?PageRank is a numeric value that represents how important a page is on the web. Google figures that when one page links to another page, it is effectively casting a vote for the other page. The more votes that are cast for a page, the more important the page must be. Also, the importance of the page that is casting the vote determines how important the vote itself is. Google calculates a page's importance from the votes cast for it. How important each vote is is taken into account when a page's PageRank is calculated.PageRank is Google's way of deciding a page's importance. It matters because it is one of the factors that determines a page's ranking in the search results. It isn't the only factor that Google uses to rank pages, but it is an important one.How to increase your page rank ?It's easy to increase page rank, simply by linking to other sites and also to be linked (this is what we cal...
More About: Page , Works , Ranks
Make more traffic with your blog
2007-11-05 18:14:00
Founded on http://sethgodin.typepad.com, I think the best and most helpful idea,for you to read and commentUse lists. Be topical... write posts that need to be read right now. Learn enough to become the expert in your field. Break news. Be timeless... write posts that will be readable in a year. Be among the first with a great blog on your topic, then encourage others to blog on the same topic. Share your expertise generously so people recognize it and depend on you. Announce news. Write short, pithy posts. Encourage your readers to help you manipulate the technorati top blog list. Don't write about your cat, your boyfriend or your kids. Write long, definitive posts. Write about your kids. Be snarky. Write nearly libelous things about fellow bloggers, daring them to respond (with links back to you) on their blog. Be sycophantic. Share linklove and expect some back. Include polls, meters and other eye candy. Tag your posts. Use del.ico.us. Coin a term or two. Do email interviews wit...
More About: Traffic , Blog , Make , With You
Boost Windows Vista Speed
2007-11-05 18:13:00
While the discussion pertains to Vista particularly, the same applies to Windows in general too ! For a general user the first three are usually more than sufficient to make your Vista faster. The remaining are some more which a tweak enthusiast may wish to consider. Utilities like WinPatrol or Tune-Up Utilities can help you in most of the cases.1. Restrict the no. of start-ups. Why have programs starting up when you dont really use them. Even those you use can always be started manually by clicking on the. I personally prefer not to have ANY starups. I click on my Internet Defense Suite manually, before connecting to the Internet. So decide for yourself which one's you really need as start-ups.2. Disable services which one may not require. For example, if your pc is a stand-alone one, there may be sevral services which you can disable or switch over to manual mode. Auto-starting and closing down of services takes time & resources. These can be saved. BlackViper's Vista Servic...
More About: Windows Vista , Speed , Boost
Hit Tracker
2007-11-05 08:37:00
Intelligent System for Tracking the web!This is my new site (project) Hit tracker is an intelligent system that will help to track your site.What's Tracking ?The idea is simple, the site collect a high page ranking from tracker (other sites that links to hit tracker to increase it's traffic).Then you submit your site for track, as the track page have high ranking and your link is on this page, google will increase your rank!So track your site now, as it's opened for all : http://hittracker.freehostia.comBecome a tracker!Tracker (sites that links to us and direct to us some traffic) will have a special listening. and top 4 tracker sites will be shown on every sites.So become a tracker to increase your ranking and trafficvisit : http://hittracker.freehostia.com for more informationOmar Abid Blog
Links Exchange
2007-11-04 09:43:00
Hi friends,If any one wants to make links exhange with post a comment with his blog or site url or send me an email (omar.abid2006@gmail.com)Here are the rules:No adult or spam sitesAll links must be viewable on your main pageIf you remove my link, I will remove yours.Post a maximum of one link in your comment.Omar Abid Blog
More About: Links , Exchange
More articles from this author:
1, 2, 3, 4, 5, 6, 7
82789 blogs in the directory.
Statistics resets every week.


Contact | About
© Blog Toplist 2009 - Supported by Web Catalog - SEO by FeWorks
eXTReMe Tracker