|
hi ,
Coulld you tell me where exactly CTS and CLS come into picture in the execution of .NET Application , at the time of source code to MSIL ? (or) MSIL to machine code ? please clarify my doubt .
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
is there a way i can write a program to run other programs as administrator while loged on as a limited users
thanks
chad
|
|
|
|
|
hi,
Windows services will help you out do this.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
can you give me a code sample to show me how to use windows services to run another program as the administrator
chad
|
|
|
|
|
Windows 2000 and above already does this. Search your Help for RunAs.
Basically, you need two applications. One is running as a service and will accept a command line that you want it to run and a username and password to tell it who to login as. The other is the interface that will get this information from the user and send it to the service for execution.
But, like I said, this already exists in Windows 2000 and above. All you need to do is make sure that the service is running using the Services control panel.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
using System;
class Class1
{
public enum Name
{
Neeraj,
Pankaj,
Ekta,
Richa,
}
public static void Main()
{
foreach(int i in Name)
Console.WriteLine(i.ToString());
}
}
I am getting error "Class1.Name denotes a class where a variable was expected"
How can i make it correct?
Regards
Neeraj
|
|
|
|
|
You can use static methods on the Enum namespace to get the results you're looking for ( well, at least to return the names ). You can't for each on an enum name.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Hi,
You can enumerate your custom type provided you need to impliment IEnumerable and Ienumerator interface. See my article for more information.;)
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
I found this example and tryed it
Export DataGrid to Excel By Bhavtosh
It doesn’t work for some reasons for all data passed may be because of the size or browser couldn’t handle it and it's opening in a browser.
I was trying to find an example of passing a DataGrid object from C# to Excel Application and open Excel Sheet instead.
Are there any way to do that?
Please help!!!
Thanks,
maximusus
|
|
|
|
|
I just export to a .csv, then open it in Excel. Excel works out the rest.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
hi,
please see the url
www.datagridgirls.com
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
If an image is inserted in the RichTextBox at runtime, how to drag/move it inside the RichTextBox with the help of mouse, just like we can move any control on the form during design time.
Please guide
|
|
|
|
|
You can see it in
http://www.codeproject.com/cs/miscctrl/csexrichtextbox.asp
kunkun
|
|
|
|
|
well, thanks for the reply, but that will not solve my problem.
Inserting an image is not the problem, what I want to do is, dgra/move the image that is already present inside the RichTextBox with the help of mouse.
regards
|
|
|
|
|
Is the a way to do Copy Paste fom a ListView? I couldn't found anything on this, I tried Clipboard but it requires to trap Ctrl + C / Ctrl + P so I don't have any clue how to accomplish this. Anybody know please help me.
Thanks in advance.
|
|
|
|
|
Handling key strokes is the easy part. Handle the ListView.KeyUp event and check the KeyEventArgs.KeyCode and KeyEventArgs.Control properties:
listView1.KeyUp += new KeyEventHandler(OnKeyUp);
private void OnKeyUp(object sender, KeyEventArgs e)
{
if (e.Control)
{
if (e.KeyCode == Keys.C) Copy();
else if (e.KeyCode == Keys.P) Paste();
}
} To copy, grab the selected ListViewItem s, pack them in a DataObject , and send to the clipboard. Note that this will only work within the same AppDomain:
public void Copy()
{
DataObject do = new DataObject("ListViewItems", listView1.SelectedItems);
Clipboard.SetDataObject(do, false);
} To paste, you unpack the copied data (if relevent) and insert into the ListView :
public void Paste()
{
IDataObject do = Clipboard.GetDataObject();
if (do != null)
{
IEnumerable items = (IEnumerable)do.GetData("ListViewItems");
if (items != null)
foreach (ListViewItem item in items)
listView1.Items.Add(item);
}
} Note that this code is untested but should give you a start of what you need to do. Implementing drag and drop is not much different.
Again, remember that this will only work within an AppDomain. To copy and paste ListViewItem s between two separate AppDomains (ex: two different instances of a Windows Forms application), you need to marshal the data. You could marshal it as a string (encode the selected ListViewItem s as a string, then decode it in the other AppDomain), or a number of other things that would be difficult to do in a managed application (like alloc'ing the items in global memory, though with objects tied to a HANDLE (native pointer) that isn't so easy).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
I'm looking to make an IE toolband (you know like google toolbar) and Haven't been able to find anything on where to get started. Could anyone give me a push in the right direction?
Matt Newman
...armed with what? spitballs!? - Zell Miller
|
|
|
|
|
http://www.codeproject.com/tools/netnamespace.asp
Many more examples if you search the forums and articles.
Judah Himango
|
|
|
|
|
|
Hello!
Anyone know of any bitorrent library och client that is made in C#? Or maybe some article about the subject?
Thanks in advance!
~~~~~~~~~~~~~~
Martin Lundberg
Student, Sweden
I have to thank every member of the Code Project for making it such a great place for a beginner to learn!
|
|
|
|
|
No, but I know of at least one in Java, (which can be converted to C#).
Azureus
my blog
|
|
|
|
|
You don't know of any very simple opensource java client? =) Azureus is to much of code for me to understand and organize =)
~~~~~~~~~~~~~~
Martin Lundberg
Student, Sweden
I have to thank every member of the Code Project for making it such a great place for a beginner to learn!
|
|
|
|
|
I've got a page with two panels. The first panel contains the search parameters (textboxes and drop downs). The second panel shows the results of the search.
On the result page, i allow paging and sorting.
Everything works great if i rebuild the dataset each time i change pages or change the sort. But when I cache the dataset in ViewState and try to change pages or the sort, it just takes my back to the parameter page automatically. Nothing else happens.
Here's my code for the Sort:
<br />
ViewState.Add("str_sortOrder", e.SortExpression);<br />
<br />
DataView dvwResults = new DataView();<br />
dvwResults = dst_searchResults.Tables[0].DefaultView[0].DataView;<br />
dvwResults.Sort = ViewState["str_sortOrder"].ToString();<br />
<br />
this.dgr_searchResults.DataSource = dvwResults;<br />
this.dgr_searchResults.DataKeyField = "aut_companyID";<br />
this.dgr_searchResults.DataBind();<br />
All help is appreciated.
Brian
|
|
|
|
|
Please redirect your question to the appropriate forum, the ASP.NET[^] forum.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Hi people, is there anything in C# that resembles "org.apache.log4j.PropertyConfigurator"[^]?
I'm looking for something that can loads configuration files and do all the dirty work for me... It should..., for instance:
PropertyConfigurator configurator = new PropertyConfigurator();
configurator.load(configFilePath);
System.Collections.Hashtable params=configurator.ConfigParams;
...
IDictionaryEnumerator enum = params.GetEnumerator();
while ( myEnumerator.MoveNext() ) {
Console.WriteLine("\t{0}:\t{1}", myEnumerator.Key, myEnumerator.Value);
... do whatever else you'd like with the parameters ...
}
...
configurator.save(configFilePath);
If it's not part of dot-NET Framework, any Open Source you'd recommend? Thanks in advance.
Norman Fung
|
|
|
|