|
Hello,
I have my VS2003 Project under Subversion control and wanted to find out (per code) which revision number has my project.
I tried:
NSvn.Core.Revision rev = NSvn.Core.Revision.Head;
NSvn.Core.ClientConfig clientcfg = new ClientConfig();
NSvn.Core.Client client = new Client(mypath);
I also looked into:
NSvn.Common
No luck so far (also google hasn't helped me this time.)
Thanks for your time and help!
All the best,
Martin
-- modified at 9:44 Tuesday 9th January, 2007
|
|
|
|
|
Here's how to get the BASE revision (the revision a working copy contains) - I use this to generate the version number for the AssemblyInfo file in the pre-build-task:
Client client = new Client();
int revision = client.SingleStatus(workingDirectory).Entry.Revision;
This operation does not contact the server, it simply looks at the .svn folder.
Getting the HEAD revision might work similar (but you have to contact the repository), try to get the status of the repository URL.
|
|
|
|
|
Hallo Daniel,
Thank you very much for your answer!
I think this is exactly what I needed!
I will test it soon.
Thanks again!
All the best,
Martin
|
|
|
|
|
Hallo Daniel,
Just tested your code sample, and I'm happy now.
Thanks again!
Martin
|
|
|
|
|
Hi,
I hadn't used data breakpoint before, but it seems it's going to come in handy. If I can actually get it to work, that is.
I'm trying to set a data breakpoint for an integer value, but can't since the option (debug -> new breakpoint -> data breakpoint) is always disabled: Either before starting the program or while stepping during runtime, it won't enable. I'm using VS2005 Pro, so I'd think it should work. Any ideas?
Standards are great! Everybody should have one!
|
|
|
|
|
Data Breakpoints can only be set in C++ Native code:
How to: Set a Data Breakpoint (Native Only)
http://msdn2.microsoft.com/en-us/library/350dyxd0.aspx[^]
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Thanks, that really sucks. I think I'll do a feature request for that...
Standards are great! Everybody should have one!
|
|
|
|
|
Hi All,
I have a case that i need to browse through the directories and files of a unix server through C#.NET or VB.NET Code. Can anyone help me out???
Exact scenario of the problem is:
i need to ftp a file to unix server from windows machine through VB.NET Code. But Before that i need the check the unix server whether the file already exist or not in a particular directory of the unix server. If the file already exist in the unix server, i have to wait until the file to be removed in the unix server and then ftp the file to unix server.
gokulnath
|
|
|
|
|
If you know how to programmatically FTP-PUT a file, couldnt you first try an FTP-GET
to see if it already exists ?
Luc Pattyn
|
|
|
|
|
I need help... I have two datagrids, one is binded to a Datatable and one is binded to a Dataset. The problem is, keydown events are not recognized on the Datatable side while on the Dataset they work. Thanks in advance.
|
|
|
|
|
Hello
I have a question about working with COM objetcs made in C#. Creating the objetcs is not a problem, my question is how to work with config files. How do I get information from an config file so that I can read it with my COM object?
My situation right now is that I have a .Net object that most of the time will be accessed by a .Net application, but somtimes by an application written in VB6 (or any language supporting COM). In the config file for the .Net application I have some parameters that I want to read, not just in the appSettings section but also for example configSections and system.diagnoostics section.
I hope that Microsoft has thought of that when they made .Net support COM, but I dont know how they did it if they did it. Antoher solution is to always try to read the config file with ConfigurationManager.OpenExeConfiguration(FilePath) but then I cant read some sections properly without resorting to converting them into a XMLDocument:
<code
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(FilePath);
ConfigurationSection confsec = config.Sections["system.diagnostics"];
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.LoadXml(confsec.SectionInformation.GetRawXml());
System.Xml.XmlNode node = doc.SelectSingleNode("system.diagnostics/switches/add[@name='Trace']");
if (node != null)
{
System.Xml.XmlAttributeCollection attribs = node.Attributes;
TraceSwitch generalSwitch = new TraceSwitch("Trace", "Controls the Trace Level");
generalSwitch.Level = (TraceLevel)Convert.ToInt32(attribs.GetNamedItem("value").InnerText);
}
</code>
Or should I abandon config files and use INI files instead?
Is there a way in an .Net object to see if the object is started by an application using COM or if it is an .Net application?
I hope the question(s) are reasonably clear and that someone could enlighten me in the way of using config files when the calling application is an COM application written in VB6.
Sorry for my bad english.
Best regards
/Marcus
|
|
|
|
|
hi,
how to retrieve string as well as int from single function
with regards
|
|
|
|
|
Your question is not very clear :->
SkyWalker
|
|
|
|
|
satyam143 wrote: how to retrieve string as well as int from single function
The preferred method in .NET is to wrap it into a class or struct . You can also specify ref and out parameters.
class BlahResult
{
public string theString;
public int theInteger;
}
class SomeClass
{
public BlahResult SomeMethod()
{
BlahResult result = new BlahResult();
return result;
}
}
|
|
|
|
|
you can return only one value in a method.
so just return an integer and then convert to string.
|
|
|
|
|
M. A. Deniz Yalman wrote: so just return an integer and then convert to string
What if the string value he wanted was not a representation of the interger?
|
|
|
|
|
|
The easiest way is to use "output parameters".
The cleaner way might be to define a class with two parameters, then return an instance of that class from your method.
|
|
|
|
|
Discussion: Would you use static member variables in the class? Why or why not?
|
|
|
|
|
Hi,
I've got a problem with reading in an xml file into a listbox
This is the code:
XmlDocument xmlDoc = new XmlDocument();
XmlTextReader xtr = new XmlTextReader(path);
xtr.WhitespaceHandling = WhitespaceHandling.None;
xmlDoc.Load(path);
while (xtr.Read())
{
if (xtr.Name.Equals("test") && xtr.NodeType == XmlNodeType.Element)
{
this.listBox.Items.Add( xtr.ReadElementString("test").ToString());
}
Thread.Sleep(10);
}
This is the xml files content:
<?xml version="1.0" encoding="UTF-8"?>
<Testing>
<test>1111111</test>
<test>2222222</test>
<test>1111111</test>
<test>3333333</test>
<test>1111111</test>
</Testing>
The problem is, it skips the "222222" and "333333" by not adding them into the listbox.
The rest of the xml file does get loaded in the listbox.
So this is what i get:
1111111
1111111
1111111
In stead of:
1111111
2222222
1111111
3333333
1111111
Can somebody point to me what i am doing wrong?
Thanks in advance!
|
|
|
|
|
If you read the documentation for ReadElementString[^] you will see that it also moves the position in the XML file on. So for each iteration you are moving the position within the file twice.
Yustme wrote: Thread.Sleep(10);
What is this for? It serves no purpose other than to slow down your application. Is that what you really want?
|
|
|
|
|
Hi,
The sleep thread is to avoid that my pc is going to hang. There are over 2000 rows to read into the list box.
Thanks for pointing that out to me. I didn't know it moves 2 positions within the file.
|
|
|
|
|
Yustme wrote: The sleep thread is to avoid that my pc is going to hang. There are over 2000 rows to read into the list box.
That makes no sense what so ever. If you put the thread to sleep for 10 milliseconds 2000 times you are waiting 200 seconds (just over 3 minutes) to load in all the data.
|
|
|
|
|
According to the documentation the ReadElementString method positions the reader on the node following the EndElement node; in you case on the next "test" StartElement node. Afterwards you call Read inside the while statement which advances the reader to the next node and thereby your code only recognizes every second "test" element. I'm not that used to the XmlTextReader, so you have to experiment a bit which method gives you the desired result.
By the way calling ToString on the result of ReadElementString is redundant as it already returns a string.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi,
Can you tell me what method you used for these kind of operations?
Thanks in advance!
|
|
|
|