|
Hi!
I don't know if you're using multiselect or not but if you are not then you can only have one element selected so, you obtain the item by doing
MyListView.SelectedItems(0)
If you have multiselect = True then you can do this:
Dim MyListViewColl As SelectedListViewItemCollection = MyListView.SelectedItems
Dim MyListViewItem As ListViewItem
For Each MyListViewItem In MyListViewColl
(...) 'do whatever you want with the object
Next
Never say never
|
|
|
|
|
Sir,
i would like to know on how to convert the hexadecimal string to the text messages using vb?
Because when i receive the sms from the mobilephone using AT command,the sms is in hex..so i cnt understand it.
May i know what is activeX and sms.OCX means and what is the function (the use of it)?
Thank you
|
|
|
|
|
In the click event sub of a winfor, how to judge it is a left click or a right click?
|
|
|
|
|
Hi!
The Click event gives doesn't give you any kind of information, basically it only tells you that you clicked in a control. In your case, because you need to know if it was a left or right click you should use the MouseDown and/or MouseUp events because the MouseEventArgs object gives you that and another information.
Never say never
|
|
|
|
|
I am sending a message using MSMQ to a network computer. i am able to send the message without any error, which i can confirm from my Outgoing Queue.
Now the problem part:
Even though the Outgoing Queue is showing that i am sending the messag, but it is not showing the Queue Message which i am sending. And i the other system's Queue is also empty. Below is the code i am using. Correct me if i am wrong.
Dim mq As MessageQueue = New MessageQueue
Try
mq.Path = "FormatName:Direct=OS:IP-Address of the system\Private$\ABC"
mq.Send("hello")
Catch ex As Exception
MsgBox(ex.ToString)
End Try
I have solved the problem, i was passing the IP address, instead i should have passed the AD name. Now it's working"
Now i am trying to get the acknowledgement of the message and this is what i am trying
Dim msg As Message = New Message
msg.AcknowledgeType = AcknowledgeTypes.FullReachQueue
msg.Body = "Hello"
now i am not sure i am getting any acknowledgement. I think that i should get an empty message in my queue as acknowledgement. Correct me if iam wrong
|
|
|
|
|
Requirement:
Need to download a csv file from a password protected site. That site uses their own (form’s) authentication procedure (i.e. not Windows authentication). That site uses cookies to store the user details.
Procedure:
Currently we are trying to submit a request to the login URL with all the values (passing all the hidden parameters and etc.) and get the cookie from the response. We are trying to make use of the cookie the in our next request to the desired the file.
Problem:
The above procedure works at some times and not at all the time. Is there any thing wrong with the procedure, or is there any other easy way to do the same.
Actually I got this code sample from site only.
Code Part:
Classes needs to be included
Imports System.Net
Imports System.io
Imports System.Runtime.InteropServices
Private Sub screenScrapingCode()
Try
Dim wp As New WebProxy(sreverURL, intPORT) ' Creating proxy with server as "10.237.3.28" and port as 6050
Dim nc1 As New NetworkCredential(UserName, Password, Domain) ' Setting the login credentials for the proxy
wp.Credentials = nc1
Dim hr As HttpWebRequest
hr = WebRequest.Create(LoginURL) 'Creating the request for the login screen
hr.Proxy = wp
hr.Method = "POST"
Dim str As String ' hidden parameters and other values to be submitted as a string
str = postData
Dim cookies As New CookieContainer ' Cookie Container to have the cookie collection
hr.CookieContainer = cookies
Dim requestwriter As StreamWriter
requestwriter = New StreamWriter(hr.GetRequestStream())
requestwriter.Write(str) ' writing the form datas to the request object
requestwriter.Close()
Dim hres1 As HttpWebResponse
hres1 = hr.GetResponse()
Dim cooki As CookieCollection
Dim url As String
url = hres1.ResponseUri.ToString()
cooki = hres1.Cookies() ' getting the cookie from the other site
hres1.Close()
Dim filename As String ' path and filename to save the downloaded file
filename = "Data_file.html"
filename = stringFilepath + filename
Dim hr1 As HttpWebRequest
hr1 = WebRequest.Create(url) ' creating the request for the csv file
hr1.Proxy = wp
hr1.CookieContainer = cookies
cookies.Add(cooki) ' adding the cookie to the next request
Dim hres As HttpWebResponse
hres = hr1.GetResponse
Dim stream As System.IO.Stream
stream = hres.GetResponseStream
' writing the data into a file
Dim writeStream As New FileStream(filename, FileMode.Create, FileAccess.Write)
ReadWriteStream(stream, writeStream)
stream.Close()
writeStream.Close()
hres.Close()
Catch ex As Exception
End Try
End Sub
Private Sub ReadWriteStream(ByRef readStream As Stream, ByRef writeStream As Stream)
Dim Length As Integer = 256
Dim buffer(256) As Byte
Dim bytesRead As Integer = readStream.Read(buffer, 0, Length)
While (bytesRead > 0)
writeStream.Write(buffer, 0, bytesRead)
bytesRead = readStream.Read(buffer, 0, Length)
End While
readStream.Close()
writeStream.Close()
End Sub
Regards,
Varathu
|
|
|
|
|
I am a VB beginner. When I use VB Winsock create the C/S connection, I found I must set the local port in Client. If I do not do that and use random local port, my program can not create the connection successfully. And even when I set the local port, it can success one or two times, then I have to change to another local port. So what's wrong?
Thanks for ur answer!
|
|
|
|
|
hi
can u tell me how to extract highlighted text in word and display it in vb.net
kishen
|
|
|
|
|
Here is a winform that load data from a class which visits the database.
Now there is several records should be return the winform.
I use arraylist, but has error.
public class classchannel
public arrChannel as arraylist
sub LoadChannel
...
while oReader.read
Dim ch As New Channel(m_ChannelID, m_ChannelName)
arrChannel.Add(ch)
Wend
End Sub
end class
public class channel
public ChannelID as long
public ChannelName as string
sub new(m_id as long,m_name as string)
ChannelID=m_id
ChannelName=m_name
end sub
end class
|
|
|
|
|
Hi rushing,
It looks like you did not initialize the arrChannel ArrayList properly. In your code you have:
public arrChannel as arraylist
If you do not assign another ArrayList to arrChannel then you will get an error because the arrChannel variable has not yet been instanciated.
To correct your code, you should make the arrChannel a "New" ArrayList. Then you can "Add" to is as you are trying to do.
This should fix your problem:
Public arrChannel As New ArrayList
Now when you "add" to the arrChannel ArrayList, you should not get any errors.
arrChannel.Add(ch)
|
|
|
|
|
Thank you , Scott .
You are right.
|
|
|
|
|
what is the equivalent code for vb.net to search the database, dataset or datarow, whatever!, (-: and display data on the screen i've tried the find method and it seems that it's not working
|
|
|
|
|
Well, first you have to decide what you want to search. Searching a database is different from searching a dataset which is different from searching a data row. What do you want to do?
|
|
|
|
|
I am VB6 programmer migrating to VB.NET and I have a question pertaining to permissions.
I've read several doc but nothing has sunk in as of yet.
What I am trying to do is create a simple application that opens a word document then place user data at specific bookmarks then print the document.
Well, I can do this on my local machine but when I place it on a shared/network drive.
I get error pertaining to permissions.
What am I missing???
|
|
|
|
|
Since a network is an untrusted source, your code gets to run inside a much stricter sandbox. On each machine, you have to go into ControlPanel/Administrative Tools/Microsoft .NET Framework Wizards, then click on Trust an Assembly. You can then adjusts the security settings for your executable on the network share. Just point the wizard at the .EXE, then tell it what level of security you want for that assembly.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is it possible to send sms from landline to mobilephone thruPC using a modem. If it is please help me with the code in VB6
|
|
|
|
|
No, since your modem can't connect to the phone. You'll have to go through an SMS service to send the message.
No, I don't have any example code. I've never had the wish to write such an application. If I wanted to send a message to someone, I just went to the website to do it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I get your point, but I wanted the code to use in an programme that should send sms to clients as riminders through a modem connected to the landline.
|
|
|
|
|
Fine, your modem calls your ISP to get a normal Internet link and you still use an SMS server to send the message.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
If you want to use your landline telephone account to send sms from a VB application you cannot do this. You can however create a VB application to send sms over any internet connection seamlessly.
As Dave said you need a service provider to handle the sms side of things. It basically uses a soap webservice that your application communicates with . We have sms in one of our applications. We use a service called textanywhere (www.textanywhere.net) which is cheap and really easy to use. They even provide code examples of how to use the service.
Jonathan
|
|
|
|
|
What way can you put code in a module to do the following at start up
1..Build a menu onto a MDI form
2..Put the MDI form properties in this module
I also had a problem when I had a MDI form and showed a new form. It was behind the MDI form.
I am new to VB.Net and trying hard to get with grips with it but I am still thinking VB6 mode.
|
|
|
|
|
You won't want to put that code in a module. If it's code specific to a form, put the code in that form.
Forms work VERY differently in VB.NET, or any of the laungages targeting the .NET Framework. You might want to read Working with Multiple Forms in Visual Basic .NET: Upgrading to .NET[^] before going any further.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
Please can someone tell me how to implement drag and drop items like text boxes that allow user input, lines to connect text boxes etc to make a flow charts like the ones found Microsoft Visio for example etc
Thanks in advance!!
|
|
|
|
|
Take a look at the "Netron Project" and see if it meets your needs. It is a complete .NET library created for just the type of application you are refering to. It contains controls that look and feel like Visio (tier and flow charting) with 1000s of other useful tools and controls.
http://netron.sourceforge.net/ewiki/netron.php?id=NetronGraphLib[^]
Hope this helps
Scott
|
|
|
|
|
I am reading a text file (line by line) from using streams. How can I detect if it contains a non-ascii or unicode chracters in .net
|
|
|
|