|
Just wondering if it is possible to set the following using .Net 1.1
- Registry Auditing
- Registry Permissioning
- NTFS Auditing
Any sample code will be of real help, thanks!
h.
before c# there was darkness
|
|
|
|
|
In Net 2.0 you can use System.Security.AccessControl namespace for various options but in .Net 1.1 the only option is using P/Invoke
|
|
|
|
|
Hy
I have a ListBox and I want to make a selection of a item but I don't want to see the selected item with an fill rectangle, I want like in C#. If I press "dad" in C# Visual Studio 2005 I see a listbox with a selection and the rectangle is no fill.
thx
|
|
|
|
|
uh...I think this is what you want
use the selecteditem event or similar to unselect your selection
|
|
|
|
|
Dear sir:
I have written one test page for up-loading the large file.
In this page:
上传
In my HttpModule, I call the function
HttpWorkerRequest.GetPreloadedEntityBody for testing.
But I cann't get the correct pointer. Null is returned from this function.
I donn't know the reason, Do you know this reason?
Thanks!:
|
|
|
|
|
Hi,
I have designed some programs on SWT and Swing using Java. There are many similar features that both c# and java have. When programming with Java I was using just one window(form) and than embed a necessary panel to it. Panels are designed seperately and named differently. For example one panel named SavePanel.java is used to save an entry(think about an address book). When the saving process is done, other panel named SearchPanel.java is called to the window. So when the user presses a button, a panel that is related to that process is called to the form.
In C# I can't find any feature like this. When I create a panel, I cannot add buttons or textboxes to them. The visual editor cannot show them.
I don't want to design one form for saving and one form for searching. Just one form is enough. According to the process that user wants some part of the form will be change. And changing part have to be designed easily using visual editor.
If any of you made something like this before, or any idea similar to this problem, please help me. Any articles, documents or related websites will be helpful.
Thanks
|
|
|
|
|
You have to add and remove UserControls to your main Form. A UserControl for Save and one for Search. Depending on what to do, add either of them to the Form.
UserControls can be designed with the Designer (Editor).
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
Hi Friends,
I need to create a service(windows) in c#.
The service has to monitor the database,(a purticular Port)
If any changes are made in Database(insert,delete etc), it has to show a
popup message (like Record inserted).
How can I approach for this.If possible send the required code.
Regards
Lakshmi
Lakshmi
|
|
|
|
|
|
I need some code to prevent my application from running if it is already running. c# visual studio 2005
|
|
|
|
|
Google for single-instance application
|
|
|
|
|
barbarini wrote: I need some code to prevent my application from running if it is already running. c# visual studio 2005
There is more than one way to attempt to solve this problem but I would encourage you to log a little time with the Mutex class.
Have fun,
Matt
It isn't enough to do well in life.
One must do good when and where one can.
Otherwise, what's the point?
|
|
|
|
|
Hi,
i am trying to add dataRow to dataTable which in turn poulates a datagridview.
But the dtaGridView shows the lattest row added.
I want to show all the data Using datatable.
someone plz help....
Sangram
(A battle with self)
Life is simple, we are the ones makes the living difficult
|
|
|
|
|
Post your code. This will help others answer your question.
Paul
|
|
|
|
|
code<
protected void btnSlabAdd_Click(object sender, EventArgs e)
{
DataSet ds = new DataSet();
DataTable dt= new DataTable();
DataColumn dc1 = new DataColumn("StartAmount", typeof(double));
DataColumn dc2= new DataColumn("EndAmount", typeof(double));
DataColumn dc3= new DataColumn("AccountShare", typeof(double));
dt.Columns.Add(dc1);
dt.Columns.Add(dc2);
dt.Columns.Add(dc3);
DataRow dr = dt.NewRow();
if (dt.Rows.Count == 0)
{
dr["StartAmount"] = 1;
dr["EndAmount"] = double.Parse(txtEndAmount.Text);
dr["AccountShare"] = double.Parse(txtAccountShare.Text);
//dt.Rows.Add(dr);
}
else
{
//dr["StartAmount"] = 1 + double.Parse(dt.Rows[dt.Rows.Count - 1].Table.Columns["EndAmount"].Caption);
dr["StartAmount"] = 1 + double.Parse(gdvDistributorSlab.Rows[gdvDistributorSlab.Rows.Count - 1].Cells[2].Text);
dr["EndAmount"] = double.Parse(txtEndAmount.Text);
dr["AccountShare"] = double.Parse(txtAccountShare.Text);
//dt.Rows.Add(dr);
}
dt.Rows.Add(dr);
gdvDistributorSlab.DataSource = dt;
gdvDistributorSlab.DataBind();
}
>
As in the above code I was trying to add datarows to a dataTable and viewing it in gridView But Everytime I can see only One row in gridView......
I want to see all the rows added to the datatable....
help please
Sangram
(A battle with self)
Life is simple, we are the ones makes the living difficult
|
|
|
|
|
Each time the event fires, you are creating a new DataTable object, adding a row to it and binding it to your control. This means that you are discarding any data that you had previously bound to the control. If you want to append your new row of data to the data you have already created you should replace
DataTable dt= new DataTable();
with...
DataTable dt = null;
if (gdvDistributorSlab.DataSource == null)
{
dt= new DataTable;
}
else
{
dt = (DataTable)gdvDistributorSlab.DataSource;
}
Paul
|
|
|
|
|
I have two forms. Form1 with a listbox (with 3 items) and a button. When this button is clicked form2 should open. On Form2 there is a tabcontrol with 4 tabpages. When Form2 loads I want it to show with just 3 tab pages. So on Form1 i have the following variable defined:
public int countItems
{
get { return listBox1.Items.Count; }
}
On form2 I have made form1 public ( public Form1 frm1; ) and in the form2 load event i have the following:
if (frm1.countItems == 3)
{
tabControl1.TabPages.Remove(tabPage4);
}
This complies with no errors but when the application is run and the button is clicked to bring up form2, the following error appeas for the line if (frm1.countItems == 3):
Additional information: Object reference not set to an instance of an object.
Can anyone tell me where I am going wrong?
Lucy
|
|
|
|
|
hi
set the count-value in the form2 constructor e.g.
Form2 form2 = new Form2(listBox1.Items.Count);
form2.Show();
in the constructor of form2 remove your tabpage.
regards
|
|
|
|
|
Hi,
I want server side session management using session object(for multiple users). How to create session Id for each user who logs in?
Be Well
Regards,
Prog-hero
|
|
|
|
|
What kind of technology are you using? ASP.NET, Remoting, Web Services, WCF?
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
Prog-hero wrote: I am using ASP.NET.
Do we need to do anything regarding session management or it is automatic? If I am using IIS server. I run the script called Installsqlstate.sql and two table created in the tempdb.
Be Well
Regards,
Prog-hero
First a link to MSDN that you should take a look at:
ASP.NET State
Sesion Management is automatic and you can use the Session property on the Page to access the Session-local data.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
If you're using IIS, then the session ID is created for you automatically.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Can anyone tell me if the following can be done directly in .net without having to delve into p/invoke?
- The drive Z:\ can be mapped to C:\blah\ or c:\wibble\
- I have a load of filenames in the form C:\ paths
- I need to filter out the ones that correspond to the current Z:\ mapping (e.g. I need to ask the system where Z:\ is pointed, and string compare the filenames with the given path)
Can anyone help? (I just need the bit that tells me the location of a subst'ed drive.)
Cheers,
benjymous
|
|
|
|
|
Here you go.
ConnectionOptions conn = new ConnectionOptions();
conn.Impersonation = ImpersonationLevel.Impersonate;
ManagementScope scope = new ManagementScope(@"\\mymachine", conn);
ObjectQuery query = new ObjectQuery("Select * From Win32_LogicalDisk Where DriveType = 4");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);
ManagementObjectCollection coll = searcher.Get();
foreach (ManagementObject obj in coll)
{
Console.WriteLine(obj["DeviceID"].ToString());
Console.WriteLine(obj["ProviderName"].ToString());
} The ProviderName is the network drive name. DriveType=4 relates to mapped drives.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks - I'm not sure if that's doing quite what I need - it's finding mapped network drives, but not locally mapped drives
(e.g. open a cmd window and type "subst w: c:\windows" - I need to find where w: points to)
|
|
|
|