|
Use System.Diagnostics.Process.Start() .
|
|
|
|
|
Question is pretty straight forward. Is it possible to check for x32 vs x64 processors in vb6?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
|
Score! Exactly what I was looking for. I figured it would be yet another call into Kernel32, but was unaware of how to do it.
Thanks!
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Hi all,
I am using visual basic express 2008
1. How do I hardcode 2 ddns servers in vb.net? Or should i hardcode? can dns.gethostentry(dim host as string) resolve my domain without me specifying which dns server use to resolve?
2. I could not run my code successfully, below is the code.
Imports System.Net
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim host As IPHostEntry
Dim hostname As String = textbox1.text
host = Dns.GetHostEntry(hostname)
Dim fqdnAddress As String = host.AddressList(0).ToString()
TextBox2.Text = fqdnAddress
Catch ex As Exception
MsgBox("Unknown error")
Finally
End Try
End Sub
End Class
modified on Wednesday, September 10, 2008 2:55 PM
|
|
|
|
|
Hi
I ran the above code just now and it works!!
Anyway is there a way to implement a line of code upon user hitting the enter key the results will be displayed? Currently I must click on button1 to resolve the domain i entered.
|
|
|
|
|
Just a small tip for future coding endeavors then:
MsgBox(Ex.ToString) or MsgBox(Ex.Message) instead of MsgBox("Unknown error")
My advice is free, and you may get what you paid for.
|
|
|
|
|
Thanks.
I follow your suggestion, changed to msgbox(ex.message), when an invalid link or non-existent domain is entered, "No host found" message box will appear.
Can anyone tell me whether system.net.dns is capable of resolving host with hardcoded server?
i know how to hardcode dns server but do not know how to continue from here:
dim dnsServer1 as IPAddress = IPAddress("123.123.123.123")
Any suggestions or advice?
Thanks.
|
|
|
|
|
What is the best approach for showing logged events and data in a window, both in situations where data will always be available a line at a time, and in situations where it won't?
One approach is to use a text box with the 'readonly' property enabled, and keep shoving new text at the end. That approach is workable, but the only practical methods of adding data are to either do something like "myTextBox.Text = myTextBox.Text & newStuff", which gets very slow pretty quickly, or else to set the selection point to the end of the text and then do "myTextBox.SelectedText = newStuff", which works better but trashes the positions of the current selection and scroll.
Another approach is to use a listbox. This offers some advantages, in that a listbox can perform well with lots of data, and an owner-draw listbox can display data in a variety of nice formats. Unfortunately, a listbox does not provide any good way for people to copy text, nor does it provide any nice way I can find to scroll when new data is added if and only if the scroll position is set to the bottom. Further, I'm not aware of any way to force a listbox to recalculate the height of all the objects therein (e.g. in response to a resize event) other than by deleting and re-adding all of them (which would be needlessly slow, would require extra handling to maintain anything even remotely resembling the current scroll position, etc.)
Are there any better alternatives to those types of controls?
|
|
|
|
|
|
I hadn't thought about it for this application. The one time I tried using a ListView, I found it confusing and couldn't figure out what was going on. It does conceptually seem like a ListView might be able to do what I'm after, but it also seems complicated. I don't care about people being able to edit stuff in the log window, but select/copy would be nice.
The ListBox is in some ways pretty good; the biggest weaknesses are:
(1) I don't know any reasonable way to have it reformat when the control width changes (to allow wordwrap). Not a biggie, and would probably be complicated to make work nicely.
(2) I don't know how to make scrolling behave sensibly (e.g. when a new item is added, scroll if the last item was visible but the new item is not; when items have to be pruned from the start of the box (e.g. keeping the last 10,000 lines) maintain the same apparent scroll position unless items on the display are getting deleted.
(3) I don't know any nice way to allow text select/copy. Right now I'm using double-click as a shortcut to copy a line to the clipboard, but that's nonstandard and seems ugly.
Of those, I'd say #2 is the only one that seems really bothersome. Any ideas how to deal with it?
|
|
|
|
|
i have a function with two parameters , I want to start the thread and want to give the address of that function in the thread.Now my question is how should i pass that function in thread.
According to my understanding , i should create a class , there i would create two variables of same type that of parameter list of function , and a function which contains that fucntion implementation .and now create an instance of the class and pass that address in the thread.
This seems to be a very lengthy process.
Please help.
Thanks
|
|
|
|
|
Nilish wrote: This seems to be a very lengthy process.
Well, if you can't be bothered writing 6 lines of code, perhaps you're in the wrong business.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
what you did not like the answers you got last time clickety[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I am using e.Graphics.DrawImage(pb.BackgroundImage,dPoints) to print the contents of a picture box. My problem is the picture box is set to use ImageLayout.Tile and I want the tiled image to print. However, what actually prints is the untiled source image, not the background as it appears on screen. Any help appreciated.
|
|
|
|
|
Is it possible to do a 'sticky' "VB FAQ" topic for questions that get asked several times per week. Stuff like: How do I convert this C# code to vb?
If certain FAQ are more in-depth, then simply provide links to the corresponding codeproject articles, msdn, etc.
On a day to day basis, there are alot of good questions and ideas; but there's also quite a few topics that get asked almost daily because users aren't using the search.
Just putting it out there as a suggestion.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
FAQs have been written, and ignored, since this forum was created.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
The good questions generally get answered and the dumb ones get dumped on, there have been a number of suggestions (including FAQs) to alleviated the issues but an idiot is an idiot and no matter what Chris tries will still post an idiot question before either searching or thinking.
You learn to take a small pleasure in dumping on the idiots or ignoring them. I do notice that the level of idiocy tends to fluctuate quite dramatically.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Ahhahha..........now that's the best response I've read in a while!
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Hi,
How can I addjust sharpening and contrast from a bitmap/image
Jan
I'm using VB.net 2008
I'm using u function like this:
Function Negatief(ByVal I As Bitmap) As Bitmap
Dim b As Bitmap = I.Clone
Dim clr As Color
For py As Integer = 0 To I.Height - 1
For px As Integer = 0 To I.Width - 1
clr = I.GetPixel(px, py)
b.SetPixel(px, py, _
Color.FromArgb(clr.A, clr.R Xor 255, clr.G Xor 255, clr.B Xor 255))
Next px
Next py
Return b
End Function
|
|
|
|
|
To sharpen an image you subtract part of the intensity from the surrounding pixels. To change the contrast you recalculate the intensity values to stretch the intensity curve.
There is some article here on cp about using a color matrix to modify images, which would work for changing contrast.
I have some code for sharpening lying around, that I thought that I would turn into an article some day...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
U have said that you have an image sharpening code lying around!Would you mind if i see it because am working on an image sharpening form which uses track bar to show the effects of sharpening, step by step as you slide the bar.
So i do hope that code would help me kick off.
|
|
|
|
|
Hi Friends,
Pls. help me to send mail in vb.net 2005.
What is the requirements to send mail?
My OS are Win XP with SP2, No mail component(MS Outlook, Outlook express, etc) configure in my PC.
Give me example and requirement to send mail through vb.net 2005.
Thank you,
Chintu Shah
|
|
|
|
|
|
Thank you for immediate reply.
But that links example not work on VB.Net 2005.
|
|
|
|