Answer Questions
goodmami XPath query problem
Hi I have a XML file like below. This XML is loaded into a DataSet, and I then create a XmlDataDocument. XmlDataDocument doc = new XmlDataDocument(dataset); Using this document, I create a XPathNavigator: XPathNavigator nav = doc.CreateNavigator(); I now want to pick all <author>-tags who has written book "Book nr 1" (only one in this case). But how do I do this This one doesn't work :| XmlNodeList nodeList = doc.SelectNodes("//root/authors/author[bookID=//root/books[bookID]]"); Kind Regards <root> <authors> <author> <name>John</name> <bookID>1</bookID> </author> <author> <name>Peter</name> <bookID>2</bookID> ...Show All
Robert Polding Retrieving username of a running process
Hello, I've a windows service who's looking the owner of the Internet Explorer running process. I retrieve the PID with following code : Dim theProcesses() As Process = System.Diagnostics.Process.GetProcessesByName("iexplore" ) Dim PID As String Dim tp As Process For Each currentProcess As Process In theProcesses PID = currentProcess.Id tp = System.Diagnostics.Process.GetProcessById(PID) Next The question is now : how can I retrieve the username who is executing Internet Explorer Thank you for your help. wum I have found a way to retrieve the username of a user using WMI. Thanks to LEPACA, you're right. The problem was an internal WMI error and I could correct it wi ...Show All
JimM5 Get Datagrid...
Hi, I currently have a populated datagrid within my c# .net application. Once the user selects a record within the datagrid, I would like to get the value within the columnX of the record they have selected. I have done multiple searches and am unable to find a solution. All help is appreciated. awesome! Glad I could be of some assistance Yes, I want it to retrieve the item within the first column ('0') but for the selected row. Shouldn't that statment suffice Thanks again :) this is also another way but probably not the best: object theColumnSelected = ds.Tables[0].Rows[ RowIndex ][ ColumnName ]; this will get t ...Show All
seewan wht is jit compiler
wht is jit compiler Hi Rajesh The high level programming languages that need to be compiled require a runtime, so that the architecture on which the language runs is provided with details on how to execute its code. All the programming languages use its corresponding runtime to run the application. For example, to run an application developed using Visual Basic, the computer on which the application will be run must be installed with the Visual Basic runtime. The Visual Basic runtime can run only the applications developed with Visual Basic and not the ones developed with any other programming language like Java. In the .NET Framework, all the Microsoft .NET languages use a common language runtime, which solves the problem of ...Show All
Fluxtah Using XML to select a user
Hello all, I am trying to create a program that presents the user with a text box where they enter a number it logs them into a system where they have specific things they can do and some they (possibly) can't. I would like to use an XML file to do this. For example Number 0000 Logs in the user Jane. Jane has admin privileges Number 1111 Logs in Dick Dick can only access the Sales portion of the program. I'm not sure if XML is the way to go with this but it seemed to be the best choice. If you need a copy of my XML file I can post it. I think it is done correctly. Thanks Thomas So, what is the question Cheers, Dimitre Novatchev Your closing tag needs to be &l ...Show All
sroughley mem usage keeps growing :(
Hi, Its a very simple app. When you click a button it will scan a specified directory for *.mp3 files: DirectoryInfo di = new DirectoryInfo(directoryTxt.Text); FileInfo[] fi = di.GetFiles("*.mp3", SearchOption.AllDirectories); and for each file, is gonna create an object of structure type Mp3File (simple struct with just 4 string fields for name, title, artist and album): for (int i = 0; i < fi.Length; i++) { Mp3File m = ID3Reader.ReadID3Tags(fi[ ].FullName); this.progressBar.PerformStep(); } the Mp3File object is given by the ReadID3Tags method which goes like: public static Mp3File ReadID3Tags(string path) { Mp3File mp3File = new Mp3File(); string fileName = path.Substring(path.LastIndexOf("\\") + 1); string fileP ...Show All
Allan Huang Passing SecureString to a web service
Hi there, I am building a windows forms client application that is attempting to send a custom soap header to a web service. The custom soap header is defined in the Service.cs of the web service as follows: public class AuthHeader : SoapHeader { public String userName; public System.Security.SecureString passwd; } The web service class exposes an AuthHeader member as a public field like so. public class Service : System.Web.Services.WebService { public Service () { //Uncomment the following line if using designed components //InitializeComponent(); } public AuthHeader sHeader; // Rest of the class .... } It is necessary to pass in credentials for impersonating the user logged on to the client application ...Show All
JohnBurns007 Selecting Node using XPath
I'm trying to essentialy select a Report based off a specific report name using xpath. oldReport however never seems to be found. Even if i just try root.SelectNodes("/Reports") nothing is returned. Please help. Report report = (Report)reports[tvReports.SelectedNode.Index]; string filename = ConfigurationSettings.AppSettings.Get("ReportsXML"); XmlTextReader reader = new XmlTextReader(filename); XmlDocument doc = new XmlDocument(); doc.Load(reader); reader.Close(); XmlElement root = doc.DocumentElement; XmlNode oldReport = root.SelectSingleNode("/Reports/Report[name='" + report.name + "']"); (tvReports.SelectedNode.Index + 1 )+ "]"); XmlElement newReport = doc.CreateElement("R ...Show All
paoloTheCool Substring with regex??
This is a simple stripping MyString.substring(1,150); but I want to strip the first 150 chars and also any of the following characters if found in the first 150 chars: HTML tags carriage returns line feeds tabs Can this be done using regex and substring or just regex How can this be done Hi NoEgo, Did the posts resolve the problem If so mark the post(s) that helped you as the answer(s), so when others search the forums, they might be more inclined to look at a successful post than a non successful one... in the search results the Answered posts are bubbled to the top before the unanswered . Or post why it failed for you. Thanks. wow, great thread, thanks! http://forums.microsoft.com/MSDN/ShowP ...Show All
Steven Syfuhs Linq To XSD
I installed l2xsd (Linq To XSD) on 2 XP machines and the install worked just fine. However, when I installed on a vista machine the install did not add the project templates to VS 2005. Is there something that I can do to make the templates show up in VS 2005. I also did not have the option to build XSD files using the LinqToXSDSchema in the Build Action on the properties windows for an XSD file. Thanks. Thanks for your help. That worked. The default path of Visual Studio template files are changed from Documents and Settings\username\Application Data\Microsoft\VisualStudio\8.0 and Documents and Settings\username\My Documents\Visual Studio 2005 to the new loc ...Show All
Moustafa Arafa Accessing XML files via network shares
Hi; Note: While our specific use is ASP.NET, this is a general "accessing XML" question. Our ASP.NET application allows a user to give it an XML filename and the app then opens that file as a datasource to generate a report. The issue we face is we do not want the file opened using the credentials of the user that our ASP.NET app is running under for two reasons: The ASP.NET user may not have access to \\hr\payroll\salaries.xml but the person requesting the report does. The ASP.NET does have access to Web.Config but the person requesting the report does not. Our app supports both forms and WindowsIdentity as an authtication/authorization method. So we do not have the client identity to use if they are using ...Show All
Pooja Katiyar Delphi 2006, UIP and .Net Framework 1.1
Hi All, We use Delphi to develop screens, Visual Studio 2003 (C#) for controller and business logic and Microsoft UIP2.0 for Navigation between screens. The screens are MDI windows forms and we have many child frames over a single parent. Problem we are facing is when we try to open a child frame, sometimes the titlebar of child frame appears and sometimes it hides causing inconsistency in the look of the screens. Have anyone faced similar problem with UIP2.0 and .NET Framework Please help us to overcome this issue. Regards, Dileep ...Show All
Bruce M xml if statement
Hi, I am trying to use the IF statement logic inside xml. So came up with the line below: The logic that I am trying to achieve is: if there is a value for the field COMX_Field1 (i.e. if COMX_Field1 = TRUE) then show COMX_Field2, else do not show anything. Is this correct Thanks <LINE ID="02"> <VALUE X="1.00" FORMULA="true"><![CDATA[=("{COMX_Field1}"="1") "COMX_field2":""]]></VALUE> </LINE> this is how we do it in xslt < xsl:if test ="CustomerName !=''"> < xsl:value-of select ="CustomerName"/> </ xsl:if > Hi, I really don't know anything ...Show All
xkx32 How to access WebServices from server?
I have a server where web services are running.I have a client application which consumes the webservices of the server.If I run my client application on another machine(other than server) and try to use web services running on the server, then I am getting 'WebException : The request failed with HTTP status 401: Unauthorised'.But if I run my client application on the server, then I dont get this message. Is there anything to be configured before getting my client application to work on machines other than the server Thanks nhd You probably are using Integrated Authentication on the Virtual Directory. Enable 'Anonymous Authentication' in IIS virtual directory properties to allow non ...Show All
Arun.kumar.sharma Easy way to combain VB.NET and C#
Hi, Is there an easy way to do that Can there be a solution with a vb project and a cs project or one must be compiled to a dll before If your main project is C#, then you first add a new C# Windows Application project. This will generate the Program.cs and Main() entry point. To add other (VB) project, just Add VB Class Library project and reference it from the main C# project. You should name your namespaces according to your architecture, not by your language preferences. Meaning - combining your solution with C# and VB projects/dlls shouldn't affect how you architect your components/classes and put them into different namespaces. Andrej Thanks alot but .. it's the other way around, the vb is the mai ...Show All
