|
You can't.
Simply spoken, when registering to the Created event, you tell the FileSystemWatcher to call your MoveFileFromSharedLog1 method whenever this event occurs. The registered method must have a specific signature (defined by delegate FileSystemEventHandler') cause otherwise it couldn't be called. The FileSystemWatcher would have no knowledge what to do with an additional int parameter and which value it should have.
Anyway, what should this int parameter be for?
"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 need to setup a path to write a file to, and the path changes depending which folder the file was created on. I figured it would be quick and easy to send in a int parameter and just say writePath =("c:\path\blah" + x); so if x came in as 1 it would write to the c:\path\blah1\, 2 would write to c:\path\blah2\ and so on.
As it is now I have 2 MoveFileFromsharedLog methods and the only difference is the writePath variable. Seems very wasteful, but not sure how else I could do it.
|
|
|
|
|
aquacadet wrote: the path changes depending which folder the file was created on
Use the FileSystemEventArgs.FullPath property to determine in which folder a file was created.
"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
|
|
|
|
|
hi all,
i have a form with many labels, textboxes or button on it.
i copied each and every labels', texboxes' and buttons' texts and place them in a txt file. then translated everything between (")-(") into english.(mainform is in my language.)
and through menustrip one can select his/her desired language. (english or turkish)
everythin works fine and i can change every label, textbox or button text.
but for messagebox'es i havent got a solution yet
for example:
in turkce.txt: this.label1.Text="Ingilizce"; translated as:
in english.txt: this.label1.Text="English";
but for error messages for now i cant do nothin
there's no this.messagebox.... ?
do i have to check the form's language first and show error messages according to the language ? or is there an easy way to reach and change text displayed in messageboxes as well ?
help please ...
-- modified at 10:41 Friday 19th May, 2006
|
|
|
|
|
Hi!
Since MessageBoxes use the language of the Language Pack you're got installed for your .NET framework, I don't think this will be possible.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
I’ve made some reports using the ReportViewer and Reports (*.rdlc-files) in visual studio 2005. I really enjoy the ReportViewer!! My reports is now generated direct from my SQL 2005 database but I now want to generate a report from a typed DataSet that is instantiated locally in the program (my typed dataset is a subset of info from the database).
How do I connect the .rdlc-file to my object? I see that I can choose Add new data source -> Object but I want in runtime to do that on my instantiated DataSet. Is that possible?
I for sure have missed something and all tips are welcomed!!
_____________________________
...and justice for all
APe
|
|
|
|
|
I have to print the contents of an html file (or stream) to a printer.
I've hunted around a bit and it seems I must use the graphics object to format my lines one at a time to send them to the printer.
In looking at some samples, this particular line of code seems to be common :
ev.Graphics.DrawString(line, printFont, Brushes.Black,
leftMargin, yPos, new StringFormat());
This is a concern to me, as my html has images in it. I dont believe I want to tell the DrawString what color to use.
Probably cause I'm new to dealing with this type of problem, I simply dont see what I really need to do.
Can someone point me to somthing that might help clear my head up?
To restate, I have HTML that I must (thru C# code) send to the windows installed default printer - I just dont see how-to!
Thanks!
-- modified at 10:20 Friday 19th May, 2006
Oh, in looking around some more I see it might be helpful to add that this HTML is being generated via XML/XSL transform inside a web service which has no visual components.
|
|
|
|
|
You could use a instance of the AxWebBrowser IE control. You have to have your HTML written to file somewhere, then navigate the IE control to it and use it to print the file.
private AxSHDocVw.AxWebBrowser axWebBrowser1;
private void Print() {
object o = null;
axWebBrowser1.Navigate(@"C:\print.html", ref o, ref o, ref o, ref o);
axWebBrowser1.ExecWB(
SHDocVw.OLECMDID.OLECMDID_PRINT,
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER,
ref o, ref o
);
}
But if you are masochistic you can draw images with your Graphics object too. Not sure I'd be interested in writting my own HTML renderer.
|
|
|
|
|
Thanks - that helped me move forward a little. Apparently in 2005 you must use WebBrowser.
I tried...
WebBrowser webBrowserForPrinting = new WebBrowser();
webBrowserForPrinting.Visible = false;
webBrowserForPrinting.Url = new Uri(@"c:\\Checkpoint\\websites\\printservice\\app_data\\books.html");
while (webBrowserForPrinting.ReadyState != WebBrowserReadyState.Loaded)
{ };
webBrowserForPrinting.Print();
webBrowserForPrinting.Dispose();
I now get an error in a browser window:
System.Threading.ThreadStateException: ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment.
at System.Windows.Forms.WebBrowserBase..ctor(String clsidString)
at System.Windows.Forms.WebBrowser..ctor()
at Service.PrintXML()
Anyone have any good ideas as to what to do with this one?
As I said - its in a web service, I dont want the browser to be visible either.
Thanks!
|
|
|
|
|
Hi all, i want to create a control that does just like a panel into Visual Studio.
If i want to set a background image i go on open file dialog at the voice background image and load the image.
I know how create this property for my cotnrol but when i laod the image it doesn't is set in my resource project directory as Visual Studio does.
How can i do it in design time?
|
|
|
|
|
hi guys!
need some help again..
how can i
call datagridview double click event on button click of a form..
abhinav
|
|
|
|
|
No matter how hard you try, the CLR won't let you raise an event from an object which does not expose that event. That's just the way it is. Why do you want to do that, anyways? Could you not accomplish whatever it is you're attempting to do by calling the method which executes when the DoubleClick event is raised (instead of raising the event)?
Josh
|
|
|
|
|
I've made a small deployment project. in that when i am trying to rollback installation if serial number entered for that by a user is wrong then i recieving an exception as "saved state got corrupted.100 % restoration won't be done". How to get rid of this exception and rollback the installaion too.
manu sharma
|
|
|
|
|
I have developed a software that takes text documents as input and after performing a few steps it generates an inverted index....and it takes a little time to do so and i want to display a percentage progress as text label.....and i ve calculated the time taken by each step in this and then changed that time into to percentage and displayed it after the button click.....but the problem now is that when i change the input files this percentage starts to look stupid.....so i want to ask that how can i calculate the percentage wich will work for all inputs..........
Looking forward for help
Regards,
|
|
|
|
|
Okay
That's for sure a bad idea to do the time calculation since for the same file, on different machines of different speeds or even in your own machine when it is busy, times may take shorter or longer....
The idea is simple: you should make get to know the size of the input file (in characters, bytes etc.) and then simply check where you are processisng now... For example if the file is 100 characters long, and you are now processing the 23rd character, you are at 23% of your process....
Hope this could give you the idea....
|
|
|
|
|
Sir the real problem is that i m reading about 350 files and i m performing one step at a time ist i read all the files then in the next step i remove the white spaces from it in next step i remove some unecessaray words from this dataset and few more steps like that i m doing it this way that i ist checked the total execution time of the program then i checked that how much time each of these steps take and then i divided that into percent of total time and then in each step i checked on the basis of all the files present and the file already processed......i hope u understand the problem now
looking forward for help
Regards,
|
|
|
|
|
Are you saying that you are looping through the files for EACH step? If so you are probably executing more loops which in itself will slow down.
Prev poster is correct though, you CANNOT make a decision based upon time of execution, it just won't work for every (many) circumstances.
BTW, I'm still unclear of what you're really trying to do!
|
|
|
|
|
1.I have a table(with 1 row) and i whant do create as many labels as columns.
Each label has to have the text equal to a column name and the position:
x:24 for everyone and label1 y = 60 label2 y = 120 label3 y= 180 and so on.
All this has to be made throw c# code.
2. How do i put the text from a textbox in a table?
PLZ HELP
|
|
|
|
|
what do you mean with table a dataTable object or a database table?
If it is a database witch kind of database and how do you connect with it?
anyway. you can get the label property text and with it do and update if it is database table:
"alter table 'tablename' add column (label.text.toUpper() datatipe(length))"
if you are talking about a datatable is even easier
datatablename.columns.add("label.text");
hopefully it will help you
NOthing by now;)
|
|
|
|
|
10x
table object.
but how do i create as many labels as column whit the propety label1.text equal to evry column name.
ex: label1.text = the name of the first column from the table.
can anyone write the code for this.
|
|
|
|
|
//i have not tryed the code so it might have some errors but i think you can get the idea
//SQL_COMMANDS (this commands will work only if you have a SQL Database)
//this command will return all the non system tables
SELECT Table_Name AS NOMBRE FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE '
//this will return all the column names from a given database and table
SELECT COLUMN_NAME as column FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME
string Query = "SELECT COLUMN_NAME as column FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME LIKE 'the_name_of_your_table'
//first you have to get all the column names of your table
Cache = new System.Data.DataSet();
using (SqlConnection Conn = new SqlConnection(this.Conexion))
{
SqlDataAdapter SqlDs = new SqlDataAdapter(Query,Conn);
Conn.Open();
SqlDs.Fill(Cache,NombreTabla);
}
//now you have all the column names and you have to iterate as many times as columns you have creating and adding to your form a lavel
//note that in your case the location will have to be assign dinamicly
foreah(DataRow row in Cache.DataTable["NombreTabla"].rows)
{
System.Windows.Forms.Label MyLabel = new System.Windows.Forms.Label();
MyLabel .Location = new System.Drawing.Point(64, 64);
MyLabel .Name = row[0].tostring();
MyLabel .Size = new System.Drawing.Size(376, 64);
MyLabel .TabIndex = 0;
MyLabel .Text = row[0].tostring();
//here we add the new label to the form
this.controls.add(MyLabel)
}
//i hope the code above can help you
NOthing by now;)
|
|
|
|
|
Hi everybody
First i need to now if in a given intranet there is a domain server and if yes be able to connect to it in order to get information about the domain.
I've been looking for this but i've not find anything about.
My code is done in C# using the 2.0 framework, but any help even in other language will be great
pleeeease. anyone can help me??
thanks everyone.
NOthing by now;)
|
|
|
|
|
Not an AD expert by any means, but have been doing somework with it lately.
Doing a dsquery server on the command line will return a list of comain controllers for your domain. I think this is a subset of cn=configuration,dc=yourdomain,dc=com. Of course, if you have no DC, that will not work .
Ryan
"Michael Moore and Mel Gibson are the same person, except for a few sit-ups. Moore thought his cheesy political blooper reel was going to tell people how to vote. Mel thought that his little gay SM movie about his imaginary friend was going to help him get to heaven."
- Penn Jillette
|
|
|
|
|
i am working on windows application. i have used cystel report in my program. and using microsoft access as a database.i have put password on access file. problem is that every time i press on button to open crystel reports database login dialog appears.it asks for login id and password. by putting these report work fine.
i don'nt want this database login dialog. but i also don'nt want to remove password from database.
what code i should make so that database login not appear and crystel report work fine without entering password again and again
Amit Grover
CDAC R&D
|
|
|
|
|
Is it have any Optional parameter in C#
If it have, How to declare in a method
Tell me please\\
thanx
-
|
|
|
|