|
no prob it is not soccer it is real fotball
|
|
|
|
|
I stand corrected
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
|
oraanupi wrote: i tested it works
Did you unit test it? If not, Google the term, find out how to do it, then apply your new found knowledge.
|
|
|
|
|
|
What kind of data did you test it with?
I haven't tried this, but I believe it will fail in all of these cases:
1.
Enter the numbers:
999999
999998
999997
When you sort them, all but one should disappear.
2.
Enter the numbers:
100
200
200
200
300
When you sort them, all duplicate values should disappear.
3.
Enter the numbers:
1000
1
When you sort them, you should get an IndexOutOfRangeException.
4.
Enter any numbers you like.
Then try to enter the number:
1000000000
This will of course not be accepted.
When you try to sort, you should get an OutOfMemoryException.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I want to open windows application from image button click of web page.
I am using System.Diagonistic.Process.Start("exe path of local machine");
But it is throwing exception related to process and thread.
|
|
|
|
|
It is not possible to open an application from within an asp.net website. The main reason for this is security and secondly, you simply can't access the client machine as the asp.net webpage codebehind runs on the server.
What are you trying to achieve?
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog
|
|
|
|
|
First of all thanks for your reply.
Actually each client will have the exe on his machine on particular path.
one more question is that System.Diagonistic.Process.Start("exe path") will it work or not.
|
|
|
|
|
Like I said before, it won't work. You will have to find another way.
What will work is when you let the user start a clickonce installation from the server.
Using clickonce is the best way to run a client application "from the server".
It will install the application on the fly and start it immidiately after that.
Be aware though that the application that is installed through clickonce is limited in security too.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog
|
|
|
|
|
Can you please explain me, How i can implement it?
|
|
|
|
|
Check this out: ClickOnce deployment[^] it should explain what it is and how it works.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog
|
|
|
|
|
|
I am using ApplicationDeployment in my project to get querystring value but i am getting error
The name 'ApplicationDeployment' does not exist in the current.
The name 'HttpUtility' does not exist in the current context.
I am not using namespace ? , if yes then what are the namcesapace for both of them.
|
|
|
|
|
I'm not sure what you are trying to do here.
Can you explain a bit more about what you are trying to do and what the exact errormessage is?
|
|
|
|
|
I have done a project in c# of chat server application using which i have made a connection with server machine using ip address and send datas to the server database but what i need is to instead of sending datas to the server machine database i want to store it in a server text file ...is it possible
|
|
|
|
|
save string in textfile[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
thanks for u'r reply.. i have inserted the code which i hav done so far below...what i hav done is connecting client and server machine using ip address and port using tcp/ip socket and sending datas so dat it's storing in aserver machine database server but now i need the datas to be stored in a text file in the server machine is it possible.
using System;
using System.Threading;
using System.Net;
using System.Net.Sockets;
using System.Collections;
using System.IO;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
namespace ChatServer
{
class AppMain
{
private ArrayList m_aryClients = new ArrayList();
public clsMaster objmaster = new clsMaster();
static void Main(string[] args)
{
AppMain app = new AppMain();
Console.WriteLine( "*** Data Collector Server Started {0} *** ", DateTime.Now.ToString( "G" ) );
string strport =System.Configuration.ConfigurationSettings.AppSettings["IPPort"] ;
int nPortListen = Convert.ToInt32(strport);
IPAddress [] aryLocalAddr = null;
String strHostName = "";
try
{
strHostName = Dns.GetHostName();
IPHostEntry ipEntry = Dns.GetHostByName( strHostName );
aryLocalAddr = ipEntry.AddressList;
}
catch( Exception ex )
{
Console.WriteLine ("Error trying to get local address {0} ", ex.Message );
}
if( aryLocalAddr == null || aryLocalAddr.Length < 1 )
{
Console.WriteLine( "Unable to get local address" );
return;
}
Console.WriteLine( "Listening on : [{0}] {1}:{2}", strHostName, aryLocalAddr[0], nPortListen );
Socket listener = new Socket( AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp );
listener.Bind( new IPEndPoint( aryLocalAddr[0], nPortListen ) );
listener.Listen(10 );
listener.BeginAccept( new AsyncCallback( app.OnConnectRequest ), listener );
Console.WriteLine ("Press Enter to exit" );
Console.ReadLine();
Console.WriteLine ("OK that does it! Screw you guys I'm going home..." );
listener.Close();
GC.Collect();
GC.WaitForPendingFinalizers();
}
public void OnConnectRequest( IAsyncResult ar )
{
Socket listener = (Socket)ar.AsyncState;
NewConnection(listener.EndAccept(ar));
listener.BeginAccept( new AsyncCallback( OnConnectRequest ), listener );
}
public void NewConnection( Socket sockClient )
{
SocketChatClient client = new SocketChatClient( sockClient );
m_aryClients.Add( client );
Console.WriteLine( "Client {0}, joined", client.Sock.RemoteEndPoint );
DateTime now = DateTime.Now;
String strDateLine = "Welcome " + now.ToString("G") + "\n\r";
Byte[] byteDateLine = System.Text.Encoding.ASCII.GetBytes( strDateLine.ToCharArray() );
client.Sock.Send( byteDateLine, byteDateLine.Length, 0 );
client.SetupRecieveCallback( this );
}
public void OnRecievedData( IAsyncResult ar )
{
SocketChatClient client = (SocketChatClient)ar.AsyncState;
byte[] aryRet = client.GetRecievedData(ar);
if (aryRet.Length < 1)
{
Console.WriteLine("Client {0}, disconnected", client.Sock.RemoteEndPoint);
client.Sock.Close();
m_aryClients.Remove(client);
return;
}
if(System.Text.Encoding.ASCII.GetString(aryRet )!="")
{
string strvalue=System.Text.Encoding.ASCII.GetString(aryRet );
char[] sep = {';'};
Array a = strvalue.Split(sep);
TextWriter tw = new StreamWriter("d://date.txt");
string path = "d://date.txt";
StreamWriter sw = new StreamWriter(Path);
string bufferOne = "trans_logging";
string buffertwo = "trans_logging";
string bufferthree = "drc_dateTime";
sw.WriteLine(bufferOne);
sw.WriteLine(buffertwo);
sw.WriteLine(bufferthree);
try
{
objmaster.Insert("trans_logging", "trans_logging", "dateTime", System.Text.Encoding.ASCII.GetString(aryRet), DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss tt"));
tw.WriteLine(objmaster);
}
catch (Exception ex)
{
Console.Write(ex.Message);
}
}
client.SetupRecieveCallback(this);
}
}
internal class SocketChatClient
{
private Socket m_sock;
private byte[] m_byBuff = new byte[1000];
public clsMaster objmaster = new clsMaster();
public SocketChatClient( Socket sock )
{
m_sock = sock;
}
public Socket Sock
{
get{ return m_sock; }
}
public void SetupRecieveCallback( AppMain app )
{
try
{
AsyncCallback recieveData = new AsyncCallback(app.OnRecievedData);
m_sock.BeginReceive( m_byBuff, 0, m_byBuff.Length, SocketFlags.None, recieveData, this );
}
catch( Exception ex )
{
Console.WriteLine( "Recieve callback setup failed! {0}", ex.Message );
}
}
public byte [] GetRecievedData( IAsyncResult ar )
{
int nBytesRec = 0;
try
{
nBytesRec = m_sock.EndReceive( ar );
}
catch{}
byte [] byReturn = new byte[nBytesRec];
Array.Copy( m_byBuff, byReturn, nBytesRec );
Console.WriteLine("Received Data {0}", System.Text.Encoding.ASCII.GetString(byReturn));
return byReturn;
}
}
}
|
|
|
|
|
|
Clue: Be a programmer, for f*ck's sake. He pointed you to some example code. It's YOUR job to implement it (or something like it). You have all the tools you need to do what you want to do (and the most important one starts with the letter "google").
|
|
|
|
|
Try a web service instead.
|
|
|
|
|
yes, it possible.
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
i also think it is possible.
i think you want to make it lighter without the database. but use the database, you can make more features right?!
use the data.io library, search intel on that library
Good luck
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
can u plz explain with sample codes so dat i can easily understand as i'm new to c#
|
|
|
|
|
background: just getting into C# and have some pretty basic questions. Using "MS Visual C# 2008 Express Edition" as the learning tool.
I have a simple project that consists of a main form that displays a grid with some data - and it works as expected. I am trying to add a login form which prompts for a user and password. The program.cs main looks like this:
static void Main()<br />
{<br />
Application.EnableVisualStyles();<br />
Application.SetCompatibleTextRenderingDefault(false);<br />
Application.Run(new MainForm());<br />
}<br />
I added the login form to this code so that it would run before the main form was displayed. I modified the code as follows:
static void Main()<br />
{<br />
Application.EnableVisualStyles();<br />
Application.SetCompatibleTextRenderingDefault(false);<br />
<br />
Application.Run(new loginForm());<br />
<br />
if (loginForm.exitStatus != "Cancel")<br />
{<br />
Application.Run(new MainForm());<br />
}<br />
}
The login form (loginForm) has two buttons: Logon and Cancel. If Cancel is hit, I set a static variable in the form (exitStatus) to "Cancel". I then check the value when I return. If the value is not "Cancel" I call up the MainForm.
When I debug the code, the login form appears and when I select the Logon button to exit it does call the Application.Run(new MainForm()); code. However, nothing appears on the screen and the program exits.
Is this a proper way to use a login form or is there a better way? I would like the login to be the first form that appears.
Thanks for any assistance!
|
|
|
|