Simple WCF chat application with database (LINQ)

Posted by Tarek N. Elsamni | Posted in | Posted on 14:47

6

This project will be consisted of a WCF service (ISERVICE [Interface] & SERVICE [C# code to implement the interface]), Server Application which will use the WCF service and finally the client(Windows Form).

In our SERVICE we will have 2 Interfaces:


The first Interface will be Implemented in Service.cs as the WCF service to make Server side operations like:
Register, Login, logout and Add Friend.

for Example:



Ths second Interface will be Implemented in the client form as a callback mehods which will be used by server to make changes in form's data to represent changes in server side.

for example:


This Application Full Source can be downloaded from this link:
Download

To Test this application you need first to import application MSSQL named: ChatDB.mdf in the attached file and run the server project then run the client to test it.

How to hide characters from being displayed on screen as they are keyed in?

Posted by Tarek N. Elsamni | Posted in | Posted on 11:00

0

As has been mentioned, standard C keyboard input routines (getc, fgets, scanf, etc.) buffer the input until you press "Enter" --- and they echo each character as its key is pressed.

Old-style DOS functions like getch() are still available in certain Windows command-line application compilers (such as Borland C, for example). getch() returns the character to the calling program but doesn't echo it to the screen.

Here is a routine that I picked up somewhere some time ago (sorry, I didn't record the source, but I am quite sure I didn't delete any copyright notice). If it turns out that it is copyrighted or patented or something: let me know.

I compiled and executed it on my Linux system, and also on my windows system (using CYGWIN gcc). Output looks the same.

Here's the function, called linux_getch():



Here's a test program for linux_getch():


Upload a file using c# as client to a PHP server

Posted by Tarek N. Elsamni | Posted in , , , , , , | Posted on 23:46

1

We'll call the PHP script "upload.php", this is what it should contain:



and this is the C# code:




PHP random password generator

Posted by Tarek N. Elsamni | Posted in , , , | Posted on 23:31

1

PHP password generator is a complete, working random password generation function for PHP. It allows the developer to customize the password: set its length and strength. Just include this function anywhere in your code and then use it.



2ADQZNUV2VG8

PHP Class to Generate/Restore backup from/to MYSQL database

Posted by Tarek N. Elsamni | Posted in , , , , , , , , , | Posted on 19:23

2

This PHP class will help you to take a backup from your MYSQL database as it will generate .gz file to be downloaded or stored on a specific path.

First you need to include the PHP class to use it:



Then you have 3 different ways to take the backup:





To restore a MYSQL database backup include restore class:


Then start restoring process:

This class & more examples can be downloaded from this link: Download