|
Hello,
You could hold your outputed filenames in a list and make a lookup in the list bevor you do the next output.
Like this (using a generic List):
List<string> fileNames = new List<string>();
string f_FileName = ...;
...
if (!fileNames.Contains(f_FileName))
{
fileNames.Add(f_FileName);
Console.WriteLine("Please check Function file-{0} fields do not match", f_FileName);
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
thanx but genericlist can be used in Dotnet framework 2.0 but im using VS2003 on framework 1.0 .. can i make use of array.. but the problem is i am not very much strong in arrays.. Do please guide me...
Thanx in advance..
Regards,
Tash
|
|
|
|
|
Hello,
<<thashif>> wrote: thanx but genericlist can be used in Dotnet framework 2.0 but im using VS2003 on framework 1.0
that's true!
<<thashif>> wrote: can i make use of array.. but the problem is i am not very much strong in arrays.. Do please guide me.
Sure!
instead of generics, you could use the StringCollection class, which is available in .Net 1.x:
using System.Collections.Specialized;
...
StringCollection fileNames = new StringCollection();
StringCollection , does also provide a Contains and a Add method, like the generic list.
Hope it helps!
All the best,
Martin
|
|
|
|
|
Hurray!!! it worked.... Thank u.. Million thanx.. Now my application is fully finished one.. once again thank you buddy...
Regards,
Tash
|
|
|
|
|
<<thashif>> wrote: Hurray!!! it worked.... Thank u.. Million thanx.. Now my application is fully finished one.. once again thank you
Wow, I'm really glad I could help!
All the best,
Martin
|
|
|
|
|
Hello again!
Apart from the solution I provided, I would like you to know, that you should take care about the ressources used by the OdbcCommand instances.
<<thashif>> wrote: cmd = new OdbcCommand...
Here you are instanciating allways a new OdbcCommand in a nested loop, and do not care about the ressources.
The OdbcCommand[^] derives from System.ComponentModel.Component[^], which does not implement IDisposable but provides a Dispose[^] method, you should call (cmd.Dispose(); ).
All the best,
Martin
|
|
|
|
|
Thanx for ur reply... as i have already mentioned my application is too big to post the complete code over here....
Martin# wrote: you should call (cmd.Dispose();).
i have a finally block which is as follows:
finally
{
if (rdr != null)
{
rdr.Close();
}
if (con != null)
{
con.Close();
con.Dispose();
}
cmd.Dispose
}
Thanx for ur advice i really appreciate it...
Regards,
Tash
|
|
|
|
|
sorry sorry i thought u were speaking abt the connection obj... okay fine i will take up ur advice of using
cmd.Dispose();
Thanx alot..
Regards,
Tash
|
|
|
|
|
<<tash18>> wrote: okay fine i will take up ur advice of using
cmd.Dispose();
All the best,
Martin
|
|
|
|
|
i want to use registry function for my remote desktop server, how to created registry function, for execute the server
from startup windows??
thanks for attention, i really need the answer urgently...
|
|
|
|
|
I'm not sure I understand your question.. Could you please elaborate?
|
|
|
|
|
how to make a software is run automatic, when windows start up.. using c#
|
|
|
|
|
Enter the path to a string value in this key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
|
|
|
|
|
how about the source code? is it need a additional variable?
how about the variable?, could you give the example(for visual C#)?
ok thanks.. GBu
|
|
|
|
|
All right.. Here's an example that will make Calculator autostart everytime you log on Windows.
using System;
using System.Text;
using Microsoft.Win32;
namespace AutostartCalc
{
class Program
{
static void Main(string[] args)
{
RegistryKey rKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
rKey.SetValue("Calculator", "\"C:\\Windows\\system32\\calc.exe\"");
rKey.Close();
Console.WriteLine("Added calculator to automatic startup. Press any key to continue...");
Console.ReadKey();
}
}
}
You should be able to figure out your own solution by looking at this. Good luck!
|
|
|
|
|
thanks, that is for console programing, do you have other example for desktop programing, or just is it that you have?
|
|
|
|
|
What exactly do you mean by desktop programming? If you want a program to run automatically when a user log on to a machine you can use the code snippet I posted. If you want a program to start whenever you start the machine (without anyone having to log on to it) I suggest you create a Service that can start the program for you.
|
|
|
|
|
calla, do you have tutorial about socket programing on C#?
and other function windows socket programming, like shutdown, logoff, chat, n keylogger??
|
|
|
|
|
Nope. But my guess is mr.Google does
|
|
|
|
|
haha, you made me laugh..... thanks 4 information..
|
|
|
|
|
Hello,
I'm exploring Visual Studio 2010 Beta 2. Everything works okay in C# so far except for the fact how to include the crystaldecisions reference library to my project.
Besides VS2010 I have Crystal Reports 2008 installed on my developing system. However when I go to the solution explorer I cannot find any Crystal library when I click 'Add Reference' and search in the .NET tab.
QUESTION: Anyone who can help finding / downloading / installing the Crystal Reports interface library?
Kind regards
|
|
|
|
|
I have upgraded an application which was using 'Visio' and 'VisiOcx' of Microsoft Office Visio 2003 version, to Microsoft Office Visio 2007 (Upgraded the application from visual studio 2005 to visual studio 2008). The upgraded application is causing issues in not triggering 'Selection Change' event for VisiOcx. Can someone help me in resolvign this issue please?
|
|
|
|
|
Hi,
I am developing a window based application in c# using vs 2008. The setting of my desktop resolution is 1024 by 768. The program will run to a computer with 800 by 600 resolution.
I tired running my program in 800 x 600 resolution but some of the controls are not displayed as it was used to be in 1024 by 768 resolution.
Is there a way to adjust the program screen including all controls when the resoluton change while the program is running?
Thanks,
Jessica
|
|
|
|
|
I have looked on google and I can't find anything that does what I need in an example..
I want to validate the textbox on keypress and make it where the user(me) can't enter anything other than a price value. like 1.99 2.99 whatever..
I have it working so far as to only allow numbers a backspace and the '.' but I can't figure out how to restrict it to only 2 places after the decimal. Any help would be great. thanks..
Here is what I have so far...
private void Price_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = !Char.IsNumber(e.KeyChar) && (e.KeyChar != '\b')&& (e.KeyChar != '.');
}
|
|
|
|
|
Use a NumericUpDown instead. It accepts only numeric input and you can specify in the designer how many decimal places it should use - no custom coding necessary.
|
|
|
|