|
You can put the exe or Shortcut of the exe in windows startup
C:\Documents and Settings\Your Computer Name\Start Menu\Programs\Startup
Thanks
|
|
|
|
|
|
Ramu.M wrote: how to start that application along with the windows
Do you mean when Windows starts or when a user logs in? In the former case, you'll need to create a Windows service; for the latter, see this[^] link.
/ravi
|
|
|
|
|
Thank you very much for providing an excellent link.
Once again Thank You.
Ramu
|
|
|
|
|
Hi everybody,
I have a quick question about listboxes. I have a project where I want to take a string, and see if a Listbox full of substrings has any matches in it. So if the big string is "abcdefg" and the listbox has "arq", "bcd" and "qrs", then the answer is YES. For example:
//listbox is populated with "chunks" of data
string xyz;
foreach(string in the listbox)
{
//does this listbox string exist somewhere in the big string xyz?
if(true)
{
//do something
}
}
I have no idea how to do this. It seems simple enough but there doesn't seem to be the right method out there.
Thanks for your time,
Michael Fritzius
|
|
|
|
|
you iterate over the items collection of the listbox, and you use methods on the string class to see if one string contains another.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Michael,
Something like this...
foreach (string item in sourceString)
if (sourceString.Contains(item))
{
}
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Hi,
I dont think your example makes much sense, unless you somehow specify the minimum
length required for the matching substring.
Without it, every string contains "" (that is the empty string)
and I expect most strings contain a vowel such as "e" or "a"
If that is nevertheless what you really want, then do what the other replies
indicate, but put it all in one more loop in which you generate all the valid
substrings of your "big string". You might want to fill a list with these
substrings once, any way you see fit.
|
|
|
|
|
Got it.
Here's how it worked out:
using System;<br />
using System.Collections.Generic;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Drawing;<br />
using System.Text;<br />
using System.Windows.Forms;<br />
<br />
namespace WindowsApplication1<br />
{<br />
public partial class Form1 : Form<br />
{<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
}<br />
<br />
private void button1_Click(object sender, EventArgs e)<br />
{<br />
foreach(string item in listBox1.Items)<br />
{<br />
if (item.ToString().Contains(textBox1.Text))<br />
{<br />
textBox2.Text += ("Substring found in entry " + item.ToString() + "\r\n");<br />
}<br />
<br />
}<br />
}<br />
}<br />
}<br />
Thanks for your help guys, something about all three replies kind of "came together" for me
|
|
|
|
|
Dear All,
Is there any way that we can check if a specific variable is declared or not
Thank you!
M. Nauman Yousuf
"Mess with the Best, Die like the rest"
|
|
|
|
|
M. Nauman Yousuf wrote: Is there any way that we can check if a specific variable is declared or not
Perhaps using reflection.
However, if a solution contains the words "using reflection", it's usually an indication that you are thinking backwards somehow. What is it that you are trying to accomplish really?
---
single minded; short sighted; long gone;
|
|
|
|
|
I am designing a simple display / edit page, by passing a variable in the url of that page. On page load i check for the variable and populate the edit more form accordingly.
But always get an error if the variable is not present.
A simple technique of try catch would be my final option if no other alternative is available
Thank you!
M. Nauamn Yousuf
"Mess with the Best, Die like the rest"
|
|
|
|
|
I recommend reading the guide on how to ask questions, so they can be understood. Also, this is an ASP.NET question.
However, the answer to what you're asking now ( as opposed to what you asked before ) is that, trivially, the query string is available to you as part of the URL, or as a collection of variables. You can iterate through it for the value you need, or look for it within the string. This does not require reflection, in fact the query string variables do not exist as variables in your code, until you declare them and search for the values in the query string to set them.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Cheers CG - that's twice you've just beaten me to it, but I'm not deleting my answer this time.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
Do you mean if the variable is part of the url...
http://www.mysite.com//myPage.aspx?MyVariable1=this&Variable2=that
And you want to check for MyVariable1 or MyVariable2 existing in the Request collection?
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
yes Malcolm thats exactly the case
"Mess with the Best, Die like the rest"
|
|
|
|
|
if(string.IsNullOrEmpty(Request.QueryString["myVariable"]))
{
}
|
|
|
|
|
J4amieC wrote: if(string.IsNullOrEmpty(Request.QueryString["myVariable"]))
{
// the variable does not exist in the URL
}
Actually, if the string is an empty string, the variable does exist in the url.
if (Request.QueryString["myVariable"] == null) {
}
if (string.IsNullOrEmpty(Request.QueryString["myVariable"])) {
}
---
single minded; short sighted; long gone;
|
|
|
|
|
try-catch is two orders of magnitude easier than reflection !
|
|
|
|
|
You can use reflection, but it seems odd to me that you wouldn't know, that's a compile time thing.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
M. Nauman Yousuf wrote: Is there any way that we can check if a specific variable is declared or not
Yes. Use Reflection for that.
SSK.
|
|
|
|
|
How can download file EvilMaker_By_Hesham.zip from this site?
Because when I am downloading, an error occur:
"
File not Found
The file '/useritems/TCP_IP_protocols/EvilMaker_By_Hesham.zip' doesn't exist. Please contact webmaster@codeproject.com.
This article appears to be an unedited contribution, meaning it has not been checked or edited by CodeProject. You should contact the author of this article in order to get any missing files.
Click here to go back to the article for this download."
Thanks.
|
|
|
|
|
Gee - which part of 'You should contact the author of this article in order to get any missing files.' is confusing you ?
The authors do not work for the site, nor are most of them even known to the site. Someone has made a mess of the upload, and so the files are not here. There's nothing anyone apart from the author can do for you.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
How can capture image from Webcam use DirectX.Capture Library and transfer it to Client use TCP/IP Connection?
If anyone have source or demo about it, please share with me?
Thank you very much.
My project is Webcam Server. WebcamServer capture video and image from Webcam and send it to WebcamClient. So WebcamClient can preview the video and image as WebcamServer.
|
|
|
|
|
If you want to send real time images, you need to host some sort of control on the client side. Or you can just set a page to auto refresh and grab an image which is updated regularly. There are tons of articles about on capturing using DX.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|