|
Never mind, i've fixed it now.
Cheers anyway.
"If you just say porn then you get all manner of chaff and low grade stuff." - Paul Watson, Lounge 25 Mar 03 "But a fresh install - it's like having clean sheets" - C. Maunder Lounge 3 Mar '03
Jonathan 'nonny' Newman
Homepage [www.nonny.com] [^]
|
|
|
|
|
In our application, we use system environment variables in our project properties in order to redirect our output files. It is done this way so not every developer and the build machine are bound to have the same absolute path.
We do this, for C++ projects, the following way: In the Project Properties, we set Configuration Properties -> General -> Output Directory to $(MyBuildDir)\Debug, for instance, and MyBuildDir resolves to c:\MyBuilds. This works very well with C++ projects, using VS.NET.
Recently, we added a C# project to our build process for this application. But setting the Ouput Directory with an environment variable, the environment variable does not get expanded and it creates a directory literally named $(MyBuidDir)\Debug under the project directory and puts the files there.
Why does this does not work like with VC++.NET? Is it because environment variables don't work with C# builds?
|
|
|
|
|
Hi Michel,
have you found a solution? We're facing the same problem
Regards
Thomas
Disclaimer: Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you.
|
|
|
|
|
in my application i would like to get the PID of the current process, does any one know how i can do this?
Thanks
Tim
|
|
|
|
|
System.Diagnostics.GetCurrentProcess().Id
|
|
|
|
|
i dont have GetCurrentProcess in the Diagnostics namespace.
Any ideas why its not there? am i calling it from the wrong place?
|
|
|
|
|
System.Diagnostics.Process.GetCurrentProcess().Id
|
|
|
|
|
Thanks very much thats got it
|
|
|
|
|
I have the Struct:
public struct Base
{
public string Name;
public string Phone;
}
public struct Operator
{
public int ID;
public Base[] OperatorData;
}
I want to populate a repeater with 2 collumns(Nome,Phone).
The following code doesn´t work.
rpt.DataSource = Operator.Dados;
rpt.DataBind();
In aspNet
<%# DataBinder.Eval(Container.DataItem,"Name") %>
<%# DataBinder.Eval(Container.DataItem,"Phone") %>
Please, help me.
How can I populate the repeater with a array of Struct ?
Thanks.
Pablo Rodrigo
|
|
|
|
|
(Hello Paresh! I'm sure you will answer...)
For simple things, DataBinding is a cool thing; Now I saw that there is a easy property to bind a DataSource with a key in the datatable:
list.DataSource=m_workset.Projekte;
list.DisplayMember="projekttext";
list.ValueMember="projektid";
Looks good but I didn't find how to get then this Value out of an item - say by double-click on an item.
Does anybody knows hot to get this valuemember out of an listboxitem?
Thanks!
Stefan
|
|
|
|
|
I hope this is wath you mean...
textBox1.Text = list.SelectedValue; or...
textBox1.Text = list.SelectedValue.ToString();
now you have 'list.ValueMember' in textBox1 or any other control or variable you may have, i hope this helps.
Signature hmmmmm.....
I look for it at home.... tomorrow.
|
|
|
|
|
Thank you. Yes, was what I meant.
|
|
|
|
|
Does anyone know how to reference to an assembly which is generated in memory from another assembly also generated in memory (compilerParameters.GenerateInMemory = true)?
|
|
|
|
|
Hi!
I have a multi file assembly that exists of two modules and a .dll that contains the manifest. If I add a reference to the manifest dll into my c# project, I can access the types within the modules, however they are not shown in the intellisense window.
Is there any way to make them appear in the intellisense window?
Thanks in advance!
- Andre
|
|
|
|
|
Hmm... they are shown for me... are you adding the projects to the same solution? I am
|
|
|
|
|
Huh? Which version are you using?
I have two c# module that I compile from the command line using /target:module, lets say part1.module and part2.module. Then I use al.exe to create a manifest for these two modules (foo.dll).
If I add foo.dll to the references list (only the file foo.dll, no projects), I don't see any of the types of the modules. However, I can use the types and compile the program.
I got a post in microsoft.public.dotnet.languages.csharp that this is a known limitation (or bug if you want so).
It would have been *sooo* nice
- Andre
|
|
|
|
|
I have the following problem :
- I devellop new inheriteded forms (visulally) , from a base form. The base form already contains some controls , among others some buttons. This works fine, but when I try to resize the new form , and I build the project, the Visual Studio designer just moves my bottons to the right . If I relocate the buttons, the same happes : they just don't want to stay put.
Different people told me they have the same problem , but didn't find a solution. Can anyone help ?
|
|
|
|
|
I need to compare content of two data fields of the same "unknown" type.
Here's the code example that doesn't work because it compare objects instead of data fields.
protected bool CompareRows(DataTable WorkDataTable, int ColumnIndex, int RowIndex_A, int RowIndex_B)<br />
{<br />
if (WorkDataTable.Rows[RowIndex_A][ColumnIndex] == WorkDataTable.Rows[RowIndex_B][ColumnIndex]) return true;<br />
else return false;<br />
}
So what I need is explicit type casting, but as the data type of the column is unknown it must be done on the runtime.
Therefore my question is: Is it possible to cast types on the fly?
Can I use DataType property of the DataColumn for type casting? How?
Any suggestions (other than .ToString() conversion)?
|
|
|
|
|
Thomas,
The Convert.Equals() method should do the trick for you here. As in the following:
DataTable Table = new DataTable();
Table.Columns.Add(new DataColumn("Test1", System.Type.GetType("System.DateTime")));
Table.Columns.Add(new DataColumn("Test2", System.Type.GetType("System.DateTime")));
DateTime s = DateTime.Now;
DataRow r = Table.NewRow();
r["Test1"] = s;
r["Test2"] = s;
Table.Rows.Add(r);
bool s = Convert.Equals(Table.Rows[0][0], Table.Rows[0][1]);
if(s)
{
return true;
}
else
{
return false;
}
Hope this helps.
|
|
|
|
|
Thanks Don
It works fine for current purpose.
But would still wanna know if it's possible to cast types on the fly using Sytem.Type object or some adequate property.
If someone know the asnwer please share it.
Thanks.
|
|
|
|
|
We intend to give our Assembly out side our group and it'll be used in any .NET application including ASPX and ASMX.
To restrict unauthorized use of this Assembly, it will demand a X509 certificate through PublisherIdentityPermission.
We want to handle distribution process in the following way.
1. Sign the Assembly which we want to give out side our group with a Certificate.
2. We will also sign caller assembly/application with the same Certificate, there by authorizing them to use our assembly.
3. Callers will Assert PublisherIdentityPermission before making actual call to our assembly (to stop the stack-walk as any upstream apps do not need to be signed), See sample code at the end.
As far as the choice between PublisherIdentityPermission Vs StrongNameIdentityPermission, we decided to go with PublisherIdentityPermission.
Because we felt it’s easy to work with certificates.
If someone could validate our thoughts, that would be great.
Sample Code Snippets
OurAssembly.dll Code
namespace Microsoft.MSCOM.MemberServices.Samples.PublisherIdentityAssembly {
[PublisherIdentityPermissionAttribute(SecurityAction.Demand, CertFile="ramCertificate.cer")]
public class ModuleClass {
public void ModuleMethod() {
Console.WriteLine("PONG: from ModuleMethod in myModule.");
}
}
}
CallerAssembly.dll Code
namespace Microsoft.MSCOM.MemberServices.Samples.PublisherIdentityCaller {
public class CallerAssemblyClass {
public void AssemblyMethod() {
X509Certificate cert = X509Certificate.CreateFromSignedFile("CallerAssembly.dll");
PublisherIdentityPermission pip = new PublisherIdentityPermission (cert);
pip.Assert();
ModuleClass mod = new ModuleClass();
mod.ModuleMethod();
Console.WriteLine("Reverting Assert.");
CodeAccessPermission.RevertAssert();
}
}
}
|
|
|
|
|
How do I create a XML as an attribute or component of a object in C#?
|
|
|
|
|
I'm not sure exactly what you mean. However you may be able to solve your problem by simply reading your XML into a string &/or an XMLDocument object in the class.
<code>
string s = getMyXml();
XmlDocument x = new XmlDocument();
x.LoadXml(s);
</code>
I havn't tried either of these, so they may not do exactly what you expect!
|
|
|
|
|
In a Windows form, I have a treeview/listview pair in a file backup app that behaves like Windows Explorer, with checkboxes for each element to keep track of what's been selected.
I'm looking for the best way to cascade a treeview check/uncheck from a parent node to all children nodes... for example, if I check "c:\winnt", I want any child nodes to also be checked, to show that everything underneath is also selected.
I'm wondering if .NET provides any built-in way to do this, or if I have to come up with my own algorithm to traverse the nodes myself... seems like a common operation in treeviews...
thanks for any help.
|
|
|
|
|
vlusardi,
There is no built in way to do this, however a simple function like the following should do what you want:
private void CheckChildNodes(TreeNode ParentNode)
{
foreach(TreeNode t in ParentNode.Nodes)
{
t.Checked = ParentNode.Checked;
if(t.Nodes.Count > 0)
{
this.CheckChildNodes(t);
}
}
}
|
|
|
|