Click here to Skip to main content
15,905,867 members
Home / Discussions / C#
   

C#

 
AnswerRe: capture finger print continuously Pin
Henry Minute12-Feb-11 3:20
Henry Minute12-Feb-11 3:20 
Questioncapture finger print continuously Pin
s_akram12-Feb-11 3:09
s_akram12-Feb-11 3:09 
AnswerRe: capture finger print continuously Pin
Dave Kreskowiak12-Feb-11 3:56
mveDave Kreskowiak12-Feb-11 3:56 
QuestionCould not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT Pin
Marat Beiner12-Feb-11 2:34
Marat Beiner12-Feb-11 2:34 
AnswerRe: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT Pin
Henry Minute12-Feb-11 3:21
Henry Minute12-Feb-11 3:21 
GeneralRe: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT Pin
Marat Beiner12-Feb-11 6:20
Marat Beiner12-Feb-11 6:20 
GeneralRe: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT Pin
Henry Minute12-Feb-11 6:32
Henry Minute12-Feb-11 6:32 
GeneralRe: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT [modified] Pin
Marat Beiner12-Feb-11 8:32
Marat Beiner12-Feb-11 8:32 
I mean the 'Run' button/Menu in VS.
I don't use any third-party dlls.

Here is a code of Program class - the server, please tell me what you think:

<pre lang="cs">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data;
using System.Data.OleDb;


static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>      
        
        private static bool listening = false;
        private static TcpListener myList;

        [STAThread]
        static void Main()
        {         
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new ConnectionForm());

                IPAddress ipAd = IPAddress.Parse("localhost");
                // use local m/c IP address, and 

                // use the same in the client


                /* Initializes the Listener */
                myList = new TcpListener(ipAd, 8001);
                listening = true;

                /* Start Listeneting at the specified port */
            }
            catch (Exception e)
            {
                Console.WriteLine("Error..... " + e.StackTrace);
            }

            while (listening)
            {
                try
                {
                    Console.WriteLine("The server is running at port 8001...");
                    Console.WriteLine("The local End point is  :" +
                                      myList.LocalEndpoint);
                    Console.WriteLine("Waiting for a connection.....");

                    Socket clientSocket = myList.AcceptSocket();
                    Console.WriteLine("Connection accepted from " + clientSocket.RemoteEndPoint);


                    new Client_sThresds(clientSocket);
                    myList.Start();
                }
                catch (Exception e)
                {
                    Console.WriteLine("Error..... " + e.StackTrace);

                    /* clean up */
                    //clientSocket.Close();
                    myList.Stop();
                }
            }
        }
    }


modified on Saturday, February 12, 2011 3:06 PM

GeneralRe: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT Pin
Henry Minute12-Feb-11 8:58
Henry Minute12-Feb-11 8:58 
GeneralRe: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT Pin
Marat Beiner12-Feb-11 9:10
Marat Beiner12-Feb-11 9:10 
GeneralRe: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT Pin
Henry Minute12-Feb-11 9:59
Henry Minute12-Feb-11 9:59 
GeneralRe: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT Pin
Marat Beiner12-Feb-11 10:39
Marat Beiner12-Feb-11 10:39 
GeneralRe: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT Pin
Henry Minute12-Feb-11 12:20
Henry Minute12-Feb-11 12:20 
GeneralRe: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT [modified] Pin
Marat Beiner12-Feb-11 13:59
Marat Beiner12-Feb-11 13:59 
GeneralRe: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT Pin
Henry Minute13-Feb-11 1:44
Henry Minute13-Feb-11 1:44 
GeneralRe: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT Pin
Marat Beiner13-Feb-11 2:01
Marat Beiner13-Feb-11 2:01 
QuestionProblem with C# code to backup sql server 2005 database Pin
M Nasir Uddin12-Feb-11 1:36
M Nasir Uddin12-Feb-11 1:36 
AnswerRe: Problem with C# code to backup sql server 2005 database Pin
Mycroft Holmes12-Feb-11 2:06
professionalMycroft Holmes12-Feb-11 2:06 
QuestionMessage Closed Pin
11-Feb-11 21:19
wenlong8811-Feb-11 21:19 
AnswerRe: Not C# question! Pin
Richard MacCutchan11-Feb-11 21:21
mveRichard MacCutchan11-Feb-11 21:21 
GeneralRe: Not C# question! Pin
OriginalGriff11-Feb-11 22:22
mveOriginalGriff11-Feb-11 22:22 
Questionhow to change the colour of buttons through timer in c# window application Pin
aeman11-Feb-11 20:22
aeman11-Feb-11 20:22 
AnswerRe: how to change the colour of buttons through timer in c# window application Pin
DaveyM6911-Feb-11 22:11
professionalDaveyM6911-Feb-11 22:11 
GeneralRe: how to change the colour of buttons through timer in c# window application Pin
aeman11-Feb-11 22:34
aeman11-Feb-11 22:34 
GeneralRe: how to change the colour of buttons through timer in c# window application Pin
DaveyM6911-Feb-11 23:04
professionalDaveyM6911-Feb-11 23:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.