|
There is no class that holds a list of all your open file-pointers that I'm aware of. You could add a list to your application, and update this list each time you open/close a file.
|
|
|
|
|
If you want to know whether a specific file is open or not you can use this: Deleting Locked Files[^] It's written in c++ but you can use P/Invoke
|
|
|
|
|
Sorry this maybe in the category of esoteric ..but has anyone ever developed an application that connects to merchantconnect to download reports. If so what is the website address.
I ran around in circles till I threw up trying to get hold of anyone in the dev team @ merchantconnect.
|
|
|
|
|
sameerhanda wrote: ever developed an application that connects to merchantconnect to download reports.
Nope. Cannot help you, but wish you good luck in the matter.
sameerhanda wrote: I ran around in circles till I threw up trying to get hold of anyone in the dev team @ merchantconnect.
Thanks a million for the visual
"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
|
|
|
|
|
Hi,
As I am populating a listbox, the scrollbar moves up and so I do not see the items being added because the scroll keeps on moving to the top...
How do I see the items as they are being added? I guess somehow I would like the scrollbar to stay at the bottom of the listbox?
Thanks
|
|
|
|
|
arkiboys wrote: I guess somehow I would like the scrollbar to stay at the bottom of the listbox?
Why would you want that? Just to 'see' what items the computer is adding? It will slow down the entire operation if you scroll down each time you add an item. It's not just 'scrolling', it's also painting an item, updating an index etc.
I couldn't see a property like "EnsureVisible", but you could try the VB-approach and do a SendKeys.
|
|
|
|
|
Hi,
lb.Items.Add(message);
lb.TopIndex=lb.Items.Count-1;
is the easiest way I found to keep seeing the new lines.
I typically add a condition to the scrolling, such as
if (Controls.ModifierKeys!=Keys.Control)...
so I can actually browse the LB while the app continues throwing text at me.
BTW: if you list the strings upside-down (by inserting at position zero),
you get it for free.
|
|
|
|
|
This is what I am doing to use threading to populate a listbox.
Question:
Do you know how I can write to the text of the winform? i.e. this.text fails
//Thread...
private System.Threading.Thread t = null;
delegate void AddToListDel(string text);
private void AddToListbox(string text)
{
if (this.lstProfileInsertStatusError.InvokeRequired)
{
AddToListDel a = new AddToListDel(AddToListbox);
this.lstProfileInsertStatusError.Invoke(a, new object[] { text });
}
else
{
this.lstProfileInsertStatusError.Items.Add(text);
}
}
private void myButton_click()
{
t = new System.Threading.Thread(new System.Threading.ThreadStart(this.GetProfileElementsValues));
t.Start();
}
private void GetProfileElementsValues()
{
//this line works
AddToListbox("START TIME : " + DateTime.Now.ToShortTimeString());
//this line fails
this.text = "processing " + i;
}
Any thoughts on how to solve this issue please?
I believe I need to have something similar to AddToListbox(string text) but for the text of the form?
Thank you
|
|
|
|
|
Yup, you're not allowed to modify the variables of other threads without locking. Imagine you and me as a thread. You own a car (that's one of your variables). Obviously, we can't drive at the same time. That's why you get an error; I'm not allowed to start steering, without asking you first.
|
|
|
|
|
You can only access the controls from the thread that created them, i.e the main thread.
There are basically two ways of doing that:
1. Use Invoke to make the main thread execute the code, just like you do in the AddToListbox method. If you know that you are always doing that from a background thread, you don't have to check the InvikeRequired property, but just invoke the code directly.
2. Put the data in a synchronised variable (use the lock keyword to synchronise both when reading and writing), where the main thread can look for it and put it in the control.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
What you need to do is add a check if an invoke is required change the text from the main thread by invoking it. To do an invoke you need to do 3 things:
1. Create an EventHandler.
private delegate void SetTextValueHandler(string value);
2. Create a function whose signature matches the delegate and does what you want.
private void SetTextValueToConsole(string value)
{
this.text = value;
}
3. Change the line that fails to something like this:
if(this.InvokeRequired)
{
this.Invoke(new SetTextValueHandler(SetTextValueToConsole), new object[1] { "processing " + i.ToString()});
}
else
{
this.text = "processing " + i.ToString();
}
|
|
|
|
|
|
|
You are welcome
|
|
|
|
|
Hi, I've read a lot of documents on capturing images and video from webcams and even some of multiple webcams. There are many questions on the web and few answers.
I am trying to implement this but am having trouble finding the right information. From my understanding the best way is using directshow when using multiple cameras. Thats fine but why can I not do this using WDM or VFW or can I?
Any help greatly appreciated. Thanks in advance....
|
|
|
|
|
How can I detect when a user has selected a different row to the current row?
I want to enable/disable toolbar 'Next' 'Previous' buttons in toolstrip based on selection location within grid.
|
|
|
|
|
SelectionChanged event by any chance?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Ashfield wrote: SelectionChanged event by any chance?
I was going to suggest video surveillance but I think your solution is better.
led mike
|
|
|
|
|
led mike wrote: video surveillance
I think its neater, but its been a long day....
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I have one Master page in master page i have create menu using link button and i have apply Same Css on All.
And I have 5 content page.
I want when my content page one is load Then Change CSS of specify link button.
I Try This Code But this Code not Working properly.
protected void Page_Load(object sender, EventArgs e)
{
MasterPage pharmacyMaster = (Pharmacy_ICaremaster)this.Master ;
LinkButton mastrlbtnCategory = pharmacyMaster.FindControl("lbtnCategory") as LinkButton;
mastrlbtnCategory.CssClass = "cssAMainLink:visited";
}
how Can I Do It.
Reply urgently .
thanks in Advance.
Ishtiaque Hussain Jalbani.
|
|
|
|
|
how about asking this in ASP.NET Forum ...
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
Head off to the ASP.NET forum.
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
I am trying to control a service remotely, by impersonating (basically using this technique: http://www.codeproject.com/KB/dotnet/UserImpersonationInNET.aspx[^]) an administrator of the remote computer and using the ServiceController classes.
The problem is that i can't start or stop the services, I can however enumerate them fine. If i add my local account as an administrator on the remote computer, and turn off impersonation I can start and stop.
Any idea why? Does impersonation not do the job?
plz halp
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);
Morgonen är tröttmans mecka
|
|
|
|
|
Hello everyone,
I have a very simple data structure representing a book, including ID/title/author/price, no more big field, all are strings. My application provides simple interface to query book information by book ID.
1.
And I want to store book information into Dictionary, book ID as key and other data as value. My question is are there any best practices about the size of a Dictionary should be? The total data is very big (a couple of G bytes monitored from physical serialized file), and I am not sure whether I should divide the data into several Dictionary or just use one?
2.
Does Dictionary use page file to swap storage (e.g. Dictionary could be able to store more information than physical memory limitation of current computer if it could use swap page file) or just use pure memory?
thanks in advance,
George
|
|
|
|
|
Hi George,
I haven't used any memory-based data structure larger than my system's physical
memory, and I don't plan to do so any time soon: the data structure would be
loaded into (virtual) memory and immediately swapped out to the page file on
disk again, yielding bad system performance.
Whenever you need large amounts of data, and certainly if you are using
only small parts of it at a time, use a database. SQLServer Express is freely
available, and SQL queries can be organized in all popular .NET languages.
BTW: A dictionary is no different from any other data structure as far as memory
behavior goes; data structures don't decide themselves on whether they get
swapped out. It is the memory manager that decides on these mathers,
irrespective of the structures or classes involved.
|
|
|
|