I have a Windows forms application running on a terminal server. I need to determine the IP addresses of each client machine.
I found a way to retreive the IP address for computers with DNS entries (example below), but several of my thin clients were set up with static IPs and have no DNS name. Is there a way to determine the IP addre...
How do I read the value of a checkbox in a word (*.doc) file in VB.net using a range object?
This is what I have so far:
Dim app As New Word.Application
Dim doc As Document
doc = app.Documents.Open("C:\myDoc.doc")
dim chkBox as Bookmark
chkBox = doc.Bookmarks("MyCheckbox")
Dim rng as Range
rng = chkBox.Range
where "MyCheckbox" is the...
I'm working on a time sheet application, where I'd like the user to be able to enter times in TextBoxes, e.g.: 8 a or 8:00 a or the like, just like you can in Excel.
Now if you enter a date in a TextBox and then use DateTime.TryParse, you can enter it in several formats (Jan 31, 2007; 1/31/2007; 31/1/2007; January 31, 2007; etc.) and .N...
I have a Word.Field object which is a checkbox and the Type property equals wdFieldFormCheckBox. I am trying to cast the Word.Field object as Word.CheckBox object but I am getting casting errors.
Dim chkBox as Word.CheckBox
chkBox = DirectCast( myFieldInstance, Word.Checkbox)
How do I cast a Word.Field object into Word.CheckBox objec...
I'm looking for some small, vb.net open source projects that make good use of unit testing. Similar to this question, but for VB.NET.
"I would like to improve my unit-testing skills by reading, examining real-world code. Could you recommend any open source projects where the source is extensively tested with unit tests?"
Thanks!
UPDA...
Hi
I followed the commonly-linked tip for reducing an application to the system tray : http://www.developer.com/net/csharp/article.php/3336751 Now it works, but there is still a problem : my application is shown when it starts ; I want it to start directly in the systray. I tried to minimize and hide it in the Load event, but it does no...
At work, I'm frequently working on projects where numerous properties of certain objects have to be set during their construction or early during their lifetime. For the sake of convenience and readability, I often use the With statement to set these properties. I find that
With Me.Elements
.PropertyA = True
.PropertyB = "Inacti...
So let's say you wanted to make a copy of a Web Form page within a .Net Project.
Is there an easier way than:
Copy Source Page
Page Source Page within project to get new page
Exclude Source Page
Rename code behind class for new page
Add Source Page Back
Sometimes I miss something obvious is there a better way to do this? I know ...
When serializing/de-serializing certain classes I've come across the need to flag or mark certain properties as CDATA elements (due to their content). I am currently handling this like so:
<XmlElement("MessageText")> _
Public Property XmlContentLeft() As XmlCDataSection
Get
Dim doc As New XmlDataDocument()
...
I am opening a XML file using .NET XmlReader and saving the file in another filename and it seems that the DOCTYPE declaration changes between the two files. While the newly saved file is still valid XML, I was wondering why it insisted on changing original tags.
Dim oXmlSettings As Xml.XmlReaderSettings = New Xml.XmlReaderSettings()
oX...
I have an xsd, , vb, xsc, and xss file for a dataset in VS 2008 that I copied over from another VS project, however I need to make changes to the dataset. Thus I got into the xsd file, created new columns, deleted ones that aren't needed, etc., etc. However I realized when I attempted to use the new dataset I did not have the vb code b...
Under normal circumstances, a VB.NET application of mine can check the ClientName environmental variable to get the name of the workstation the user is connecting from.
So when WorkstationX RDPs into ServerA:
ComputerName=ServerA
ClientName=WorkstationX
That works fine.
If I right-click on the application and choose Run As Administ...
With the following code:
Dim x As System.Xml.Linq.XElement = _
<div>
<%= message.ToString() %>
</div>
Dim m = x.ToString()
...if message is HTML, then the < and > characters get converted to < and &rt;.
How can I force it to skip this encoding?
...
My present contract engagement is at a large E-Commerce company. Their code base which has origins going back to .Net 1.0 has caught me by surprise to contain many issues that raise the level of smell beyond the last crap I took.
That notwithstanding and trying to diffuse my level of distraction from it, I go along merrily trying to ad...
I am currently refactoring an application that prints its status to the console window. At the moment I am doing something like this:
Console.Write("Print some status.....")
//some code
Console.WriteLine("Done!")
Now while this works fine, all the logic is hidden between console.writelines and I find makes it very hard to read.
...
I've got a VB.NET module that reads from a resource file to display text in the correct language. Here's my problem - this code is shared between a web application and a non-web application, In the web application, I'm using System.Web.HttpContext to determine the user's preferred language, but now my Windows app won't even compile, beca...
Hi, i have a few text boxes and buttons on my form.
Lets say txtBox1 is next to btnSubmit1,
txtBox2 is next to btnSubmit2,
txtBox3 is next to btnSubmit3.
How can i set the focus on btnSubmit3 when the user starts to type something in txtBox3.
Meaning..... if a user type in a text box the program will know what button to fire when the u...
Is there a way to create a function/sub signature that accepts an arbitrary typed generic in vb.net.
...
I want to create a similar behavior to the data reader class but for a bespoke emailer program so that I can do the follow
Dim sender As New EmailSender(emailTemplate)
While sender.Send()
Response.Write(sender("HTMLContent"))
End While
Is there an advised interface or mustInherit class to utilize the stepping functionality so that s...
I need to add localization to the exceptions thrown by my application as a lot are ApplicationExceptions and handled and logged to an error report. Ideally I want to create a new Exception, imheriting from ApplicationException that I can pass the resource key as well as arguments to, so that the exception messsage can be built up from t...