|
Dear All,
i have developed a desktop based application using C#.NET, which require access to some USB based devices.
I have to use this application on target PCs in which the USB port is disabled by the system administrator.
From the application, i wants to enable & disable the USB drives programatically, so that no other application can use the USB ports, as per configured by the system administrator.
ie, enable the USB port before the application require access to the USB port it & disable it after the use.
I need to achieve the same when the application is running in a login, who doesn't have administrative rights.
Is it possible to achieve the same using .NET framework?
Do any one knows how to implement the same. If so, please inform me.
Best Regards,
Abhilash Chandran
|
|
|
|
|
Using the standard drivers for USB, you can't do what you want, no matter what language you use. Hardware is shared system-wide and is completely abstracted from your application, giving you no control over access to the USB ports. You would have to write your own USB drivers in order to support this.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I have a Windows Form app that contains a combobox (as a dropdownlist). I am able to populate the combobox. However, I am seeing some strange behaviour when I try to set the SelectedValue to an item in the list.
This is how I populate my combobox:
Method 1. This works.
// The "" indicates no custom first row. GetList() returns DataSet.
cbState.DataSource = GetList("spGetStates", "");
cbState.DisplayMember = "Text";
cbState.ValueMember = "Value";
cbState.SelectedValue = "AL" // This positions correctly
Method 2. This does NOT work.
// The "--" indicates first row in combo will contain this value. GetList() returns DataSet.
cbState.DataSource = GetList("spGetStates", "--");
cbState.DisplayMember = "Text";
cbState.ValueMember = "Value";
cbState.SelectedValue = "AL" // This does NOT position correctly.
The only difference between Method 1 and 2 is that Method 2 inserts a row into the dataset. If I were to use "AK" in method 2, it would work correctly. There is something about the second row in table.
Here is the method that populates DataSet:
public static GetList(string spName, string FirstRow)
{
// Populate dataset. Some code left out to keep it simple
ds = ....;
if (FirstRow.Length > 0)
{
DataRow row = new DataRow();
row["Value"] = FirstRow;
row["Text"] = FirstRow;
// Add row to top of list
ds.Tables[0].Row.InsertAt(row, 0)
}
}
Here is some sample data:
EXAMPLE 1 (using "--" parameter)
value text
------------
-- --
AL Alabama
AK Alaska
EXAMPLE 2 (using "" parameter)
value text
------------
AL Alabama
AK Alaska
Any thoughts on how to get the positioning to work for Method 2 using the value "AL"?
Thanks.
Steve
|
|
|
|
|
I am not totally sure I understand the question, but you can not set the selected item by setting the selectedValue or selectedText. You can only set the selected Item by using the SelectedIndex and SelectedItem. If you want to select AL then you would need to do something like:
You might need to loop through the comboBox to check the value and find the index.
cbState.SelectedIndex = columnIdx
Hope that helps.
Ben
|
|
|
|
|
I have seen a way to do this a week ago, but cannot find the link. I want the user to view all the items in the combo box, but I don't want them to change the value. Has anyone seen this link or know the answer? The combo box is on the form. It is not in any other control. Thanks
|
|
|
|
|
|
Combobox1.DropDownStyle = ComboBoxStyle.DropDownList
Tirtha
Miles to go before I sleep
|
|
|
|
|
I have tried this already and it still allows the user to select another item (other than the original selected item) in the dropdownlist. This is what I want to prevent. I want them to view it, but not select another item. I want it locked.
|
|
|
|
|
Then why you are not using ComboBox1.Enabled=False after Selecting the item.......Moreover what do u actually want to do by that...why are u using combo when u dont want your user to select item from it???I am bit confused.....
Tirtha
Miles to go before I sleep
|
|
|
|
|
Hi. I ended up temporarily doing the following:
F2.cmbPub.SelectedValue = strPub
F2.cmbPub.Enabled = False
F2.cmbPub.DropDownStyle = ComboBoxStyle.Simple
This disables the box showing the selected value only. I am coming from a browse screen that has a datagrid with 2 unbound boolean columns, Edit and Delete. The rest of the columns are bound. When I check the Edit box it shows the detail screen with the information for the selected item. I just wanted to be able to allow the user to display the values in the combo box, but not be able to select from it. I wanted the default to be the selected value.
I will use the above code for now, but just wanted to know if there was a way to do it. Thanks.
|
|
|
|
|
I have a windows form with a datagrid control. I bind the grid to my datasource and then add 2 unbound boolean columns. I create a tablestyle so that I can display these columns (Edit, Delete) in columns 0 and 1 before the bound columns. I can check the check box in the column and it branches to where I want it to go, but unless the row and column coordinates are (0,0) it does not display the check mark until I exit my other app and return to the grid. I displayed the value in the column and it is set to True.
I added the code from http://msdn2.microsoft.com/en-us/library/ms996485.aspx to make the check box respond to one click.
How do I get it to show the mark prior to the DataGrid MouseUp Event? That's where I branch to my other app. I have turned off tristate.
I want the user to see the check mark when they first click the check box.
Thanks.
|
|
|
|
|
|
i am a new user and i wanna seriously your help.
After i was going to the interview with the director of InfoPlus company for finding a job , he ask me if I know a solution for creating a setup project and remain any body to copy the software or use it in other computer.
he want to get the customer a copy of the software in the DVD and after the istallation no body can use this software.
I need this solution cauz it help me to have a job .
thanks any way
etretyertyery
|
|
|
|
|
tantoun wrote: i am a new user and i wanna seriously your help.
After i was going to the interview with the director of InfoPlus company for finding a job , he ask me if I know a solution for creating a setup project and remain any body to copy the software or use it in other computer.
he want to get the customer a copy of the software in the DVD and after the istallation no body can use this software.
I need this solution cauz it help me to have a job .
thanks any way
I'm amazed that you think that you can leave an interview, look for help from people and then go back and answer the question. The fact that you have posted this question here shows that you are not the right person for the job. Do you think that we should get in touch with this director and let him know?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hey after the interview the DBA give an application that contain the same and this is for a week .
Sadly you don't don't trust me but in our case i think that u r not the qualified person to get me an answer.
thanks anyway . I am Elie Abdo from lebanon
etretyertyery
|
|
|
|
|
tantoun wrote: hey after the interview the DBA give an application that contain the same and this is for a week .
Sadly you don't don't trust me but in our case i think that u r not the qualified person to get me an answer.
thanks anyway . I am Elie Abdo from lebanon
You're right - I'm not qualified to give you the answer. I'm only a software professional with over 20 years experience and I've only been using .NET since the first beta. Oh yes, I also own a software company and do the hiring - so I definitely know nothing.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O'Hanlon wrote: I'm not qualified to give you the answer
I don't think the OP has any idea that some of us around here been programming since before he was born
|
|
|
|
|
Oh, that's a sobering and frightening thought. Am I really that old?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O'Hanlon wrote: Am I really that old?
I've been asking myself that for a while now. Not old, just a bit wiser :->
|
|
|
|
|
|
http://sean.o4u.com/ap/calendar/calendar.htm[^]
This link above is a Chinese calendar. If you move mouse to any day on the calendar, it will pop up some informations about Chinese.
This page can be downloaded.
I have question that...is there any method to grab the pop up information of this page ? I wite a windows form and I hope I can do this.
Can any one help me?
thanks very much.
|
|
|
|
|
I need to display the file system entries if the user types a file path in a textbox. Is there any implementation for this purpose.
For an example try typing "C:\" in Start Menu -> Run dialogue.
I am using framework v 1.1
|
|
|
|
|
Hi,
These feature is implemented in .Net framework 2.0 but not in .Net 1.
Here a usefull link that contains some code to implement Autocomplete feature :
http://blog.theple.com/neoworkadmin/folder/13.html?uid=65[^]
Go to the section : Ability to add Auto-Complete to any Text Box
HTH.
Hayder Marzouk
|
|
|
|
|
|
I'm using ms winforms reportviewer control in local mode.
I need to use expresion evaluator function in TextBox value expression.
This function should take expression as string parameter and return evaluated value using current scope, like
<Value>=MyClass.eval("Fields!"+ MyClass.MyFieldName()+ ".Value")
</Value>
Any idea how to implement MyDll.eval() function ?
Andrus
|
|
|
|