|
This may seem like a difficult problem to solve, but what you need is a piece of server software that keeps track of the number of instances currently running. Then in your client software (the actual application being run), you need to have it first connect to the server software and find out how many instances are currently running. If greater than zero, display a message to the user, otherwise allow the program to continue.
Hope this helps.
Phil
|
|
|
|
|
Hi all,
i am making a windows based application, here i am using a DataGridView(of C#2.0)
here i wanna add a label control in my GridView,
i have to fill a colomn say(LabeledData) with a Label Control For each row,
hope u got me.
please help me solving this problem
bye byes,
thnx in advance
prashanth
prashanth
|
|
|
|
|
Hi,
In visual 2005 I Created a new MDI project and by defualt it has a nice GUI with menus and toolbars. In addition, I have create a child form and can successfully load within the MDI parent form. Now, I would like to change the top menus i.e File,Edit,Help sorting order whenever a childform is opened that has it's own menu.
For instance by default:
File Edit View Help
When a childform is opened I want to display its menu like
File Edit GridView View Help
Thanks
|
|
|
|
|
Never done it myself but I think this should be possible using the MergeOrder and MergeType properties of MenuItem class or MergeAction and MergeIndex properties of ToolStripMenuItem class, respectively.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I'm calling another C# service from a http request handler and I need to add a persistant cookie to the service request.
I've tried from within the procedure that initiates the service call:
HttpCookie mycookie = new HttpCookie("myCookie");
httpContext hc = HttpContext.Current;
myCookie.Value = File.ReadAllText("c:\\temp\cookie.txt");
hc.Request.Cookies.Add(myCookie)
<call the="" service="">
What I get is the HttpContext is Null and I can't add anything to it. I'm obviously going about this the wrong way, can someone give me a shove in the right direction?
Thanks in advance!
|
|
|
|
|
Hi,
I want an client Server Application.Where reliability is main issue.
In my application, there will be huge and frequent data to be transfered.
Which one shall i use.
Eswar
|
|
|
|
|
SakthiSurya wrote: Which one shall i use.
The first one.
Seriously, your question is too broad and general to get a meaningful answer. You're more likely to get a meaningful answer if you post specific questions, e.g. "For a client/server architecture where both are .NET apps, should I use .NET remoting or WCF?"
|
|
|
|
|
Both of my applications are in C#. At Present I am using Asynchronous
Socket Programming. Reliability is my main concern. I cannot achieve this in
Asynchronous Socket Programming.I have to send data frequently that too from
more than one client.
Sakthi.
|
|
|
|
|
My password validater window form cant read the password from database that have been set please help me;
database name=testing
table name = table1
field name=password
the default password I set in password is "ABCD"
below is the coding:
/////////////////////
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Data.SqlClient;
using System.Windows.Forms;
namespace cuba3
{
public partial class Form1 : Form
{
Form2 form3 = new Form2();
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender,EventArgs e)
{
string connectionString = "server = P-III; database =testing;uid=sa;pwd=;";
SqlConnection conn = new SqlConnection(connectionString);
string commandString = "SELECT password from table1";
SqlDataAdapter dataAdapter = new SqlDataAdapter(commandString, conn);
string strEnteredPassword = textBox1.Text;
if (strEnteredPassword == commandString)
{
this.Hide();
form3.ShowDialog();
}
else
{
MessageBox.Show("Wrong password entered");
this.Close();
}
}
}
}
tq in Advance.
|
|
|
|
|
krajah1984 wrote: if (strEnteredPassword == commandString)
wanting something to work doens't make it so
you have to actually execute the command, and then read it with a reader, or alternatively fill a dataset with the results and read them from there.
Look up some ADO.NET tutorials.
What you are doing right now, and where it fails, is easily explained:
krajah1984 wrote: string commandString = "SELECT password from table1";
SqlDataAdapter dataAdapter = new SqlDataAdapter(commandString, conn);
string strEnteredPassword = textBox1.Text;
if (strEnteredPassword == commandString)
you are checking if "ABCD" is equal to "SELECT password from table1".
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
Tq for reply.
Where is my mistake and what to add,im beginer for database connection.
|
|
|
|
|
I told you what your mistake was. You can't just compare a command to the desired result. You have to execute the command, get the results, and then compare these.
Pleae follow this tutorial, it will help you a lot probably:
http://www.codeproject.com/cs/database/DatabaseAcessWithAdoNet1.asp
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
|
Hi,
I m trying to extract all the images tags from the HTML page,
i tried the below regex pattern,
<img\s.*src=.*>{1}
this works fine when the HTML pagesource has tags in the single line..
This patterns fails when the image tag is splitted to two or more lines..
eg.. <img
height=73
alt="rtg, software="" testing="" services"
src="sample_files/rtglogo.gif" width="186" border="0">
plz help me.
regards,
nas
|
|
|
|
|
Just put the entire HTML file into a string, remove the carriage returns then run your reg expr.
|
|
|
|
|
hi,
thanx for reply..
i tried that too but unfortunately, i get only one match that too a huge line of all the code..
regards,
nas
|
|
|
|
|
Did you remove \n and \r?
|
|
|
|
|
|
Try <img[^src]*src=[^>]*>{1}
|
|
|
|
|
that won't work because you can't have 's', 'r' or 'c' before the 'src' portion of your img.
Sadly I don't have the answer (I'm trying to understand regex too)
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
Very true, in that case - <img[^>]*src=[^>]*>
That's even if he needs the src= bit in there, would probably work as <img[^>]*>
|
|
|
|
|
Hello all,
I am using a Windows Mobile 5.0 PPC device. I have a c# application that uses GPRS to communicate with back-end systems. Now, I want to prevent any user of the device from using the phone (e.g. dial numbers, make calls etc) and at the same time, allow my application to connect to GPRS.
In a way, I just want to disable (turn off) the phone program. I have tried to turn off phone manually but this prevents my application from connecting to GPRS with a message "Cannot connect. Ensure that your phone is turned on and correctly configured and that service is available, before trying again".
Any help please. Thanks!
Ashvin Gunga
|
|
|
|
|
I'm playing around with resources files, adding images to them etc, but I saw that you can also add string values to it, how advisable would it be to add a connection string in that, for example database connection string?
Thanks in advance
He who laughs last is a bit on the slow side
|
|
|
|
|
Hello,
Can you give additional information what you want to achieve?
I have used resource files (for the string values) mainly dealing with the localization issues, whereby my application interface has to be in difference languages etc, and resource files provide great help. Otherwise, using resource files to keep your images etc..embeds the resources in your assembly, thus you won't need any other extra files such as .jpg etc..
The connection string can be a constant in your code as well. Does this help?
Ashvin Gunga
|
|
|
|
|
Ashvin Gunga wrote: Can you give additional information what you want to achieve?
I learning myself C# and came across this, so there's nothing I want or need to do, just wondered how it worked and what it is for. The fact that you can load icons and images appealed to me because I didn't need to include them to the solution, just added them to the resource file and reference them from there.
That's when I came across the strings you could save and wondered what type of string you would save in there
He who laughs last is a bit on the slow side
|
|
|
|