Categories

Showing posts with label Free Source Code. Show all posts
Showing posts with label Free Source Code. Show all posts

Monday 9 July 2012

Programming with RFID Reader


Im back again this time i will show how to use RFID Reader in VB6 Currently im developing Loadable E-Pass System for a confidential client and i want to share some of of codes regarding RFID and VB6. These is pretty straight forward i used MSCOMM (serial library in .NET) component in order to read /write buffer connected to PC's serial/usb port. This is done by using the oncomm() event in order to read all the buffers send by the RFID interface without using the timer control.



Private Sub Form_Load()
On Error Resume Next

' Fire Rx Event Every Two Bytes
MSComm1.RThreshold = 2

' When Inputting Data, Input 2 Bytes at a time
MSComm1.InputLen = 2

' 2400 Baud, No Parity, 8 Data Bits, 1 Stop Bit
MSComm1.Settings = "2400,N,8,1"

' Make sure DTR line is low to prevent Stamp reset
MSComm1.DTREnable = False

' Open COM1
MSComm1.CommPort = 1
MSComm1.PortOpen = True

If MSComm1.PortOpen = False Then
MsgBox "RFID not Connected!! system will shutdown!!"
End

End If



End Sub

Private Sub Form_Unload(Cancel As Integer)
If MSComm1.PortOpen = True Then
MSComm1.PortOpen = False
End If

End Sub



Private Sub MSComm1_OnComm()
Dim sData As String
Dim lHighByte As Long
Dim lLowByte As Long
Dim lByte As Long

' If Rx Event then get data and process
If MSComm1.CommEvent = comEvReceive Then
    sData = MSComm1.Input ' Get data
    lHighByte = Asc(Mid$(sData, 1, 1)) ' get 1st byte
    lLowByte = Asc(Mid$(sData, 2, 1))  ' Get 2nd byte
    lByte = JoinHighLow(lHighByte, lLowByte)
    
    strnumber = CStr(lByte)
    
    
    ItemDatabase.txtID = strnumber
 
      

End If
End Sub

Private Function JoinHighLow(lHigh As Long, lLow As Long) As Long
JoinHighLow = (lHigh * &H100) Or lLow
End Function

Updates:
USB to RS232 converter compatible:
Download and install prolific drivers.
For more info please download the sample project Happy coding for Design projects, custom web and windows application, please visit

Facebook Fan Page
comments

Thursday 7 June 2012

.NET Twitter Gadget


REST API The REST API enables developers to access some of the core primitives of Twitter including timelines, status updates, and user information. If you're building application that leverages core Twitter objects, then this is the API for you. Imagine building a profile of a user: their name, their Twitter handle, their profile avatar, and the graph of people that they are following on Twitter - all with a few RESTful API calls. 

In addition to offering programmatic access to the timeline, status, and user objects, this API also enables developers a multitude of integration opportunities to interact with Twitter. Through the REST API, the user can create and post tweets back to Twitter, reply to tweets, favorite certain tweets, retweet other tweets, and more.

Facebook Fan Page




comments

VB.NET GIS Project


-.NET Application demo using Google Places API
-added getdirection API
-Google Map ver. 3 API
-calling/invoking Javascript from .NET Forms

-great for advance GIS developer



Facebook Fan Page


comments

Sample How to capture data from Magnetic Swipe Card reader/Credit Card Reader

This Sample app shows how to use Magnetic card reader or credit card reader from MAGTEK
http://www.hallogram.com/barcodes/scanners/mag/
in your Windows based project in POS-Inventory, Payment using Credit Card Processing ,etc very useful for resto, gas stations, grocery stores,etc.
This time we will be using their SDK/ Active X/ COM components provided by MAGTEK for this model in the link above instead of using MSComm Component or Serial port class (.NET).
Magnetic swipe card Overview
Magnetic swipe card readers for the PC are shipped with your choice of RS232, Keyboard Wedge or USB interface.
Features
Powered by USB, Keyboard Wedge Port or Serial Port (No external power supply required)
Single, Dual and Three track capability
Bi-directional read capability
Reads encoded cards that meet ISO, ANSI, and AAMVA standards
Up to 1,000,000 passes with ISO-conforming cards
Includes USB or KBW interface
Dual color LED Red/Green
KBW version includes Windows® driver available to simplify application programming.
For questions and Full working Credit Card Processing Projects
just Contact me @ the Addresses below:
Download Code: 
Sample Project
Facebook Fan Page



comments

Invoking JavaScript function from WinForms

I've been working on application that needs to load page and display it in WebBrowser control. Requirement was to allow interaction between WinForms application and web page.
Here I will show a sample application where JavaScript function is called from WinForms application.
For this Blog I will be using Google Web elements , Google Web Elements allow you to easily add your favorite Google products to your website.
Process can be described by following steps:
Create Windows Forms application
Drop WebBrowser control into Form
Create Html with JavaScript function you want to call
Calling JavaScript function from WinForms application isn't so difficult.
.NET WebBrowser control has property Document which gets an HtmlDocument representing the Web page currently displayed in the WebBrowser control.
Well this javascript part is not well written ,maybe my Web God-Like Buddy (Rustan)) can clean this mess..lol
anyway here's the script
JAVASCRIPT
  1. <script type="text/javascript">
  2. google.load("elements", "1", {packages: "keyboard"});
  3. var kbd;
  4. function onLoad() {
  5. var content = document.getElementById('content');
  6. // Create the HTML for out text area
  7. content.innerHTML = '<div>' +
  8. 'Demo of Invoking JavaScript using .NET' +
  9. '.</div>' +
  10. '<textarea id="t1" cols="47" rows="7"></textarea>';
  11. kbd = new google.elements.keyboard.Keyboard(
  12. [google.elements.keyboard.LayoutCode.ENGLISH],
  13. ['t1']);
  14. }
  15. function ChangeLayout() {
  16. var LayOut=document.getElementById('txtLang').value;
  17. kbd.setLayout(LayOut);
  18. }
  19. function toggleVisible() {
  20. if (kbd.isVisible()) {
  21. kbd.setVisible(false);
  22. } else {
  23. kbd.setVisible(true);
  24. }
  25. }
  26. google.setOnLoadCallback(onLoad);
  27. </script>
So how can you call JavaScript functions in your WebBrowser control? Call the InvokeScript method on the HtmlDocument.
.NET CODE (winforms)
  1. Sub SHOW_HIDE_VIR_KEYBOARD()
  2. With Me.WBrowser
  3. .Document.InvokeScript("toggleVisible", New Object() {""}) 'call the javascript from the .htm files
  4. End With
  5. End Sub
  6. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdShow.Click
  7. SHOW_HIDE_VIR_KEYBOARD()
  8. End Sub
  9. Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
  10. With Me.WBrowser
  11. .Document.GetElementById("txtLang").InnerText = Trim(Me.ComboBox1.Text) 'parse data from winforms to Htm files
  12. .Document.InvokeScript("ChangeLayout", New Object() {""}) 'call the javascript from the .htm files
  13. End With
  14. End Sub
Conclusions:
With the ability to call JavaScript from .NET App you can now embed and extend web applications into native applications with ease. A native application gives you more control over the environment and access to computer resources that you cannot access from a web page. You can Mashup web applications with computer hardware or software in new and interesting ways.
For the complete sample please download the demo project
For questions just Contact me @ the Addresses below:
Download Code: 
Sample Project
Facebook Fan Page



comments

Wednesday 6 June 2012

Sending SMS using AT Commands via GSM Modem/GSM Phone (receiving SMS-updated)

SMS Server VB Classic version

THE FULL SEND AND RECEIVED SMS SERVER with  complete Source Codes for developers are available to purchase.
.NET version is also available 
Feel free to contact me at the addresses and links below:
Demo:
This a sample how to send SMS using AT Commands like in Hyper Terminal via GSM Modem or compatible GSm phone attatched to the PC Comport or USB port..
For this sample i used Huawei E160 GSM/HSDPA/GPRS modem..
demonstrate how to use MSComm Control in VB6 in order to send data to the GSM Modem
TODO:
this code may not work with other modem so better check your modem's specs and manual
check your modem's settings (baud Rate,RtsHold,HandShake, etc .and comport number in order to run this project..
Good NEWS:
java and php version will out this month..
THE FULL SEND AND RECEIVED SMS SERVER with  complete Source Codes for developers are available to purchase.
Feel free to contact me at the addresses and links below:
feel free to use and improved my sample code, 
Goodluck
Questions and request?
Download Code: 
Sample Project
Facebook Fan Page

comments

How to use GOOGLE MAP API and GOOGLE Earth PLUG-IN in VB6



This tutorial shows how to use Google Map API and google earth Plugins in vb 6. I used HTML file to view the Google Map interface in VB form. I used this in my GPS SMS, Tracking System, Flight Simulation and some Mapping projects so i cannot provide the complete project , just the sample how to run the API in your VB Form. You can figure it Out
 TODO; 
>fast internet connection is needed to run the sample >for this sample i used my current Latitude and longitude to plot the placemark. you can freely customize or improved it and use any programming language that you want(PHP, C#, HTML, ASP.NET, Android, FLASH and many more. 


Goodluck Questions and request or Custom projects?



Download Code: 
Sample Project
Facebook Fan Page

comments

.NET Code (Sending and Receiving SMS using AT Commands via GSM Phone )

You can request for the Demo version or obtain the full source code of .NET SMS Server (pure AT commands, no OCX or dll) , just contact me @ the addresses below.







comments

.NET TV Tuner (Digital/Cable/Analog )



By 2015 all analog/Cable TV will be replalced by Digital TVs using Digital Signal like in Japan and other advance countries
The NTC decided that the Philippines will use and adopt the ISDB-T, finally.
So geek-gadgets people can watch live HD Channels for  free and Paid (PPV) from their PSP, Mobile Phones ,Tablets and ofcource PC and Laptops.
Sources:
I decided to do a research in order to interface and  create a Windows based Digital TV Tuner using .NET and COM32 components. 

Hardware Requirements:
1)Digital TV Tuner Installed (in my case I used Pixel View and Encore TV Tuners)
Programming Requirements:
1)MSVidCtl (COM32 Components)
sample Codes still in BETA.

Thanks and Enjoy!!! HAppy Coding!!!
Download Code: 
Sample Project
Facebook Fan Page




comments

INPOUT32.dll under .NET (Sending Data via parallel port )



Sample how to send data to LPT or printer port using INPOUT32.dll from Lakeview Research..
This time .NET version , very handy and quite stable under Windows XP.
Good for Software-Hardware Engineers and design projects.
  1. Option Strict Off
  2. Option Explicit On
  3. Module InpOut32_Declarations
  4. 'Inp and Out declarations for port I/O using inpout32.dll.
  5. Public Declare Function Inp Lib "inpout32.dll" Alias "Inp32" (ByVal PortAddress As Short) As Short
  6. Public Declare Sub Out Lib "inpout32.dll" Alias "Out32" (ByVal PortAddress As Short, ByVal Value As Short)
  7. End Module
DLL downlload links

Paste the INPOUT32.dll to C:\Windows\System\
Thanks and Enjoy!!! HAppy Coding!!!
Download Code: 
Sample Project
Facebook Fan Page


comments

.NET Language Translator using Google Translate API


This is a sample app written in .NET on how to use the Google Translate API.

Can be ported to your existing App or even use as a Client Google Translator (Windows version)

Feature:
  • Support all functions of Google Ajax Language API.
  • CLS compatible. It can be used by any .NET languages (VB.NET, C++/CLI etc.)

Google Translate API for .NET 

Description:
Provides a simple, unofficial, .NET Framework API for using Google Ajax Language API service.

    TODO:
    Download API from Google then ,make a reference to your project (Silverlight, C#, .NET, WPF, etc)
    Then make an instance in order to call the API.

    Thanks and Enjoy!!! HAppy Coding!!!
    Download Code: 
    Sample Project
    Facebook Fan Page




    comments