|
How can I see what drive letters are being used by the system so i can return a list to the user that shows what drive letters are not being used?
|
|
|
|
|
System.IO.Directory.GetLogicalDrives()
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Sorry for the long post but I've been stuck on this for a while now and I'm hoping anyone can help.
I'm trying to make an ASP.NET usercontrol that renders 'buttons' (linkbuttons within table cells) that, when clicked, fire delegates. After having some initial problems with serialisation to ViewState, I have managed to make it respond to the click and fire the delegate, without issue.
The usercontrol has a private Hashtable that stores the buttons to render, which is persisted through ViewState, and a private IsDirty boolean that is set to false on initialisation and true if any changes are made to a button or the Hashtable. I expose the following methods to the rest of the app:
- RegisterButton(...) -> This adds to the Hashtable
- IsButtonRegistered(...) -> This queries the Hashtable
A button is a LinkButton that is dynamically generated, with a standard click event. The click event code retrieves the delegate and executes it.
As a test, I have a page with a usercontrol. This usercontrol registers a button on Load. The delegate for that button is also within this usercontrol. The delegate's job is to create another button if it is not already create. As such, the usercontrol's code is as follows:
<br />
private void TestUC2_Load(object sender, EventArgs e)<br />
{<br />
DelegateButtons db = (this.Page as Default).DelegateButtons1;<br />
if (db != null && !db.IsButtonRegistered("foo"))<br />
db.RegisterButton("foo", "Foo", "dbutton", new ButtonAction(this.TestAction));<br />
}<br />
<br />
private void TestAction()<br />
{<br />
DelegateButtons db = (this.Page as Default).DelegateButtons1;<br />
if (db != null && !db.IsButtonRegistered("bar"))<br />
db.RegisterButton("bar", "Bar", "dbutton", new ButtonAction(this.TestAction));<br />
}<br />
If I step into this code, I can see that the 'foo' button is created as it should be. If I click the button, the TestAction method is called as it should be, but while inside the TestAction method, the 'bar' button is already registered. As such:
Hashtable
1. Page loads for the first time {}
2. TestUC registers a 'foo' button {foo}
3. Page is drawn {foo}
4. ViewState is saved {foo}
5. User clicks 'foo' button {foo}
6. Page loads {}
7. ViewState is loaded {foo}
8. Button click event is called {foo}
9. TestAction is called {foo}
10. TestAction checks if 'bar' exists {foo,bar}
11. TestAction says 'bar' exists so doesn't recreate it {foo,bar}
12. TestAction finishes, step returns to click event {foo}
I'm really stuck as to why this could be -- can anyone help?
Regards,
J.
|
|
|
|
|
When i run my application on account diffrent than admin application generate this error:
Unable to open shim database version registry key - v2.0.50727.00000
and closing.
Any idea how can i fix it?
Greetings
|
|
|
|
|
|
I'm using the System.Net.Mail client.Send(MailMessage) (Visual Studio 2005) method to send an email confirmation that a new contact has been added to an email distribution list. Before adding the contact to the relevant distribution list database, I want to confirm that the contact's email address is a valid one, so that if, say, the user made a typo when entering the email address, he can know.
By using error catching, I can catch and report formatting errors in the email address, but if the format is correct but the address itself is not a valid one, no error is caught. Is there a way to check for successful delivery of an email shortly (almost immediately) after sending it? Thanks.
|
|
|
|
|
Won't the it throw an exception if it can't resolve the address of the email server. I.e. hjakfhjksd';# is not a valid email so that's caught by your validation. But support@microsoft.com is but may not exist. Surely there's a timeout of some sort if there's no response from the server.
Note, just my thoughts, havn't tried it yet.
As of how to accomplish that have you ever tried Google?
Failing that try .
|
|
|
|
|
No, there isn't. The only way to be sure that a mail has reached the recipient is to make the mail program send a read confirmation. Otherwise you can never be sure where the mail went. It can be filtered as spam by the sending server, by the recieving server or by the recipients mail program, or it can be held in a queue for hours or days before the server concludes that it can't be sent. There is no way to get an immediate confirmation, though.
If there was, that would be the dream for spammers. They could create email addresses by random, and get an immediate response whether the email address existed or not.
---
b { font-weight: normal; }
|
|
|
|
|
Hi all,
i have an application with a menu, and each time i click on the menu a different userControle is loaded in the main view. Some of those user controls takes time to load and the display is quite ugly when loading. So i thought i could display a specific user control with something like "please wait loading" while the real user control is loading in background, and when its done display the real one.
I searched all over google but couldn't find what i need, so i ask here if someone know how to do that
Thanks
|
|
|
|
|
if you wanted to just display "please wait loading", you could consider having a function that you call when beginning to load the control to display the message, and another to close it when done.
i would not bother making the app multithreaded for something this simple, as it could be more hassle, unless you still want the user to interact while the control is loading. (Though this is only my opinion.)
|
|
|
|
|
Why not preload all of the controls at startup (using s splash screen while this happens), then just enable and bring to front (change the z-order) the one you want to activate (disable the one being replaced). Changing the z-order will be much faster, and you get the loading out of the way at startup.
|
|
|
|
|
What is your application, Web or Windows?
Use something like
UserControl.visible = false;
Label.visible = true;
The reverse when user control is ready
only two letters away from being an asset
|
|
|
|
|
How to READ/WRITE to/from Microsoft Access database
Thanks
Vasildb
|
|
|
|
|
See the System.Data.Oledb namespace classes,
|
|
|
|
|
hi,
i have a database connected to a datagrid, and i would like so sort the cells of a column
ex: name and address are the culumns and i would like to display the same addresses
how do i sort this?
thx
|
|
|
|
|
the datagrid must be bound to a dataview. this has a filter property that u can set to filter specific data.
I not 100% how to get this correct, u will have 2 look at the help to get the details, but it will be something like
dataview.Filter = "Address = A Road";
|
|
|
|
|
You may also use ;
// dt is a DataTable instance, address is the filter string
DataRow[] dr = dt.Select("ADRES='" + address+ "'");
cheers...
|
|
|
|
|
With this method, do u have to update the binding between the datagrid and the rows once you have done the select?
|
|
|
|
|
Sure you have to
|
|
|
|
|
thx;
but how do i get just them visible?
dr.visible= true;
and how do i hide the rest?
if (dt.select("h") -> just an example to get all the rows with an h in on screen
{ dr.visible=true;}
else
dr.visible = false;
or are there other ways?
thx
|
|
|
|
|
lo,
i have found a way to init the filter:
db1DataSet.tabel1.DefaultView.RowFilter = " name LIKE '%" +
txt_sort.Text + "%' ";
but here i only look at column "name" and i want to search in every column
also i need to make these visible
hmmm keep thinking :p
|
|
|
|
|
lo;
the solution i found is :
private void btn_sort_Click(object sender, EventArgs e)
{
db1DataSet.tabel1.DefaultView.RowFilter =" name LIKE '%" + txt_sort.Text + "%' ";
dataGridView2.DataSource = db1DataSet.tabel1.DefaultView ;
}
but now i have to make a button that will set the filter to his default
not sure how to do that but ill find it
|
|
|
|
|
my problem is the following:
I have one datagrid and i want to add one column (named Status) which a text description regarding to a item status. This datagrid in binded to a typed dataset, but in this DS the column status is represented as a number (0 [for waiting], 1 [for ok], and so on). What`s the best approach to map the numeric representation in the DS to a textual representation in the datagrid column? (I don`t wanna loop throught my datagrid and change de Status column value.)
Thanks in advance... :]
|
|
|
|
|
i have achieved this by having another table containing the status representations, then binding the status table to the column with the values, and they will automatically set to the status definition.
|
|
|
|
|
i haven`t understand. how can i "automatically" do that?
but i`m thinking about a event do accomplish that. any ideas?
|
|
|
|