Topics
-
- 29 replies
- 60.2k views
I am trying to send an email with the following code: Dim smt As System.Web.Mail.SmtpMail Dim sm As New System.Web.Mail.MailMessage() sm.To = registry.Read(clspmRegistry.RegKeysEnum.EmailErrors) sm.Subject = strSubject sm.From = strFron sm.Body = strBody sm.Priority = Web.Mail.MailPriority.High smt.SmtpServer = "[my email server]" smt.Send(sm) I am getting "Could not access 'CDO.Message' object." ?? I am finding alot of references to this problem but no solutions on the web. Got any ideas? Also, what I really need to do is send through an email server that re…
Last reply by Calobima, -
- 0 replies
- 4.3k views
Ignore, resolved the problem Why would a WebRequest return data that is hours out of date? Do I have to set something to ensure that it's not looking at cached information. It worked so well yesterday, and today it's hopeless...
Last reply by rbulph, -
- 0 replies
- 2.6k views
I build an app and i want it to block surfing when a "user" didn't chose, but I can�t find a way to stop the network adapter from c#. I saw and tried a lot of examples and advices from all other the net, but none worked for me. I tried to disabled the adapter- public void DisableNetWork(string interfaceName) { SelectQuery wmiQuery = new SelectQuery("SELECT * FROM Win32_NetworkAdapter WHERE NetConnectionId != NULL"); ManagementObjectSearcher searchProcedure = new ManagementObjectSearcher(wmiQuery); foreach (ManagementObject item in searchProcedure.Get()) { if (((string)item["NetConnectionId"]) …
Last reply by yaniv, -
- 1 reply
- 7.8k views
Hi guys, I'm making an VB.NET application that allow user to log in to a server that use the third-party OAuth service from another server. I got the log in packets like below: 1st packet: POST [b]/1st_url_session_third-party_service[/b] HTTP/1.1 Content-Length: 175 Content-Type: application/x-www-form-urlencoded Host: [b]{third-party.com}[/b] Connection: Keep-Alive User-Agent: {user_agent} Accept-Encoding: gzip Accept: application/json Authorization: OAuth oauth_consumer_key="{key}",oauth_nonce="65L3uQ",oauth_signature="lHCIs%2Bs3Z7MVnm1FUfS6cqOmu0g%3D",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1374631148",oauth_token="",oauth_version="1.0" device_typ…
Last reply by ghostshadow189, -
- 0 replies
- 8.9k views
My application uses httpwebrequest class to access a secured service. I have received a certificate which I installed on the pc. the web service requires a username and password. I get the following message when running the app: "The underlying connection was closed. Could not establish trust relationship for the SSL/TLS secure channel" My code is below but I don't know what is wrong or what else to do. Thanks. Dim cert As System.Security.Cryptography.X509Certificates.X509Certificate cert = System.Security.Cryptography.X509Certificates.X509Certificate.CreateFromCertFile("c:\was33.cer") Dim defaultUri As String = String.Empty default…
Last reply by groads2, -
- 0 replies
- 9.3k views
I have a service that uses the tcpClient to send and receive data. I can unplug the network cable and the service does not know the connection has been broken. This is the code that is used to test the connection. The call to send does not throw an error. How can I get my service to know the connection has broken? Any help is greatly appreciated. Private Function IsConnected() As Boolean SyncLock (_sendSyncObject) If Not _tcpClient Is Nothing Then Try If IsConnectionInCloseWait() Then Return False Dim data(0) as byte _tcpClient.Client.Blocking = False _tcpClient.Client…
Last reply by groads2, -
- 0 replies
- 2.5k views
IIS hosted WCF service does not work Hi all: I am trying to learn WCF. I have tried serveral examples from the Web which do not work as they were instructed for me. I must be doing something wrong but am not sure what. I have windows 7 home, VS2012. I created a solution call Greetings. In the service I added a class Library where I put the Interface and Service class. To that solution I added a website using the wcf service template type. I added the reference to th greeting class library that has my interface and service class. This is supposed to be hosted by IIS. I wrote a client app to access the service but the error tells me there no service at the endpo…
Last reply by groads2, -
- 1 reply
- 7.1k views
I am learning web services and want to get this client working. I get the error "Cannot send a content-body with this verb-type" You can see I have set the method to "POST". The error comes when I try to execute the line with ws.getRequestStream. Any Ideas? Thanks. Public Class Form1 Dim myUrl As String = "http://www.webserviceX.net" Dim ws As System.Net.HttpWebRequest = System.Net.WebRequest.Create(myUrl) Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Try ws.Host = "www.webserviceX.net" ws.Method = "POST" ws.Timeout = 60000 ws.Accept …
Last reply by groads2, -
- 0 replies
- 4.1k views
I am trying to learn how to write a web client. I wrote a WCF web client to the same site in the code below and that worked. I would also like to write one similar to the code below. Any ideas on what I am doing wrong would be great. I am getting the error: InnerException = {"Content-Length or Chunked Encoding cannot be set for an operation that does not write data."} Public Class Form1 Dim manualWebClient As New System.Net.WebClient() Private Sub Jack() Handles Button1.Click manualWebClient.Headers.Add("Content-Type", "text/xml; charset=utf-8") manualWebClient.BaseAddress = "http://ws.cdyne.com" Dim reqstr As String = "<s11:Envelope xmlns…
Last reply by groads2, -
- 4 replies
- 2.4k views
Hi all: I have been given a set of schemas and wsdl. I have to write an application that will submit a request to a service and get a response. I don't even know where to begin. Can someone tell me What type of service I am writing and some of the things I may need to do to make use of the schemas and wsdl to make a valid request? I hope this is even enough info for someone to give me some direction of what I can do to start. Please excuse my ignorance. Thanks.
Last reply by groads2, -
- 0 replies
- 1.7k views
Hi everyone, Following is the callback method that I use in my socket programming at client side for async receiving of data from server:- Public Sub OnDataRecieved(ByVal async As IAsyncResult) Dim Recieved_Size As Integer = m_clientSocket.EndReceive(async) ...........(rest of the code) End Sub What my doubt is that when "Recieved_Size" = 0, should I conclude that the socket has got disconnected? If not, then under what cases should Recieved_Size be = 0 ? Why I am asking is that whenever the connected server gets disconnected then "OnDataRecieved" method gets called and the resulting "Recieved_Size" is = 0. But it should be called only whe…
Last reply by sattu, -
-
- Administrators
- 3 replies
- 4.7k views
ok so i am really sorry if this has been answered before i am not the best at at VB.net by far anyways i have a problem, i have written some code in a VB i have made that pings a server and give me and MS and writes it on the app, now what i need is it to be able to ping the port in the same equation but i am not sure how and if i can even implement it into my code, the reason behind this is that it pings a game server, so when the servers are not up they close a port, anyways i will put some code here and see if you guys think i can implement it if not any pointers will be greatly appreciated If InternetConnection() = True Then Dim p As System.…
Last reply by PlausiblyDamp, -
-
- 1 reply
- 4.2k views
how can you make the web request not use a proxy at all? (not use the system proxy)
Last reply by BrettW, -
-
- Administrators
- 3 replies
- 4.2k views
Hello all, I am new to xtremedotnettalk and this is my first thread. I am trying to create a function in vb.net that sends a website header through a socket to the server and returns the response. This is my code. Public Function GetSiteResponse(ByVal IPEndpoint As IPEndPoint, ByVal client As Socket, ByVal header As String) As Byte() client.Connect(IPEndpoint) If client.Connected Then Dim sendbuffer As Byte() = Text.Encoding.ASCII.GetBytes(header) client.Send(sendbuffer, sendbuffer.Length, SocketFlags.None) Dim recievebytes As Byte() = New Byte() {} Do Dim recievebuffer(350) As Byte …
Last reply by PlausiblyDamp, -
-
- 1 reply
- 1.8k views
Hello, I am using visual basic 2005. I found on the web the following function that extracts HTML from webpages. It is very useful but unfortunately it does not work with redirected pages. That is, when I put in it a URL of a redirect page it gives me nothing or error. I added to it ".AllowAutoRedirect = True" but still it did not work. I wonder how to make it work for redirected pages. I appreciate the help. Public Function GetPageHTML(ByVal URL As String, _ Optional ByVal TimeoutSeconds As Integer = 10) _ As String ' Retrieves the HTML from the specified URL, ' using a default timeout of 10 seconds Dim objRequest As Net.HttpWebRequ…
Last reply by haydenw, -
-
- Administrators
- 1 reply
- 2.1k views
I have up to 20 computers that need to connect to a Vaisala weather device to gather a small amount of data in 10 minute intervals. The particular moment in time is random for each PC, but always on a 10 minute period as the pressure, temperature, and humidity do not change quickly enough to require more data. Anyway, I periodically get this error: 01:56:32 Vaisala System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine at System.Net.Sockets.Socket.Re…
Last reply by PlausiblyDamp, -
-
- 0 replies
- 3.1k views
Hello , Please bear in mind that im not an experts, and my knowledge hardly exceeds what google search results has to offer a noob. i have a multi-client server application, for video conferencing, and everything works good untill more than 4 or 5 users connects to the server. I know i should be using UDP, not TCP, but this is the way i did it, and i want you to take a look at it and tell me what you think. Client Connection Code VideoSoc = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); int Videoport = 8003; IPAddress server_ip = IPAddress.Parse(textBox1.Text); IPEndPoint ConnEndPoi…
Last reply by osos, -
-
- Administrators
- 3 replies
- 3.4k views
i have this code, with only one url at first, which seems to freeze the UI for about a minutes. i wanted to get the web page html faster asynchronously, but this is not working for me Is the httpwebrequest faster? Private Sub Test(ByVal sender As Object, ByVal e As DownloadStringCompletedEventArgs) Dim newstring As String = e.Result.ToString listBox1.Items.Add ("Finished" & e.UserState.ToString) End Sub Sub Button1Click(sender As Object, e As EventArgs) for each item as String in textbox1.Lines Dim SiteURI As New Uri(item) Dim wc As New WebClient wc.DownloadStringAsync(SiteURI) AddHandler wc.DownloadStringCompleted, AddressOf Test next End Sub
Last reply by PlausiblyDamp, -
-
- 0 replies
- 4.9k views
This one seems to be pretty weird. I'm using asynch TCP sockets in my program. I have one class called ConnectionManager (implemented on the server machine), which has this NetMain event running on its own thread: Private Shared Sub NetMain() Dim TcpListen As TcpListener = New TcpListener(m_ListenPoint) Try TcpListen.Start() Catch ex As Exception RaiseEvent Exception(ex) End Try ServerGroup = New EthServerPool() Do If (TcpListen.Pending) Then If (ServerGroup.UpperBound < m_MaxClients) Then ServerGroup.AddSock…
Last reply by gayouj, -
-
- Leaders
- 3 replies
- 4.2k views
Hi Everybody, I think I have a somewhat difficult question, but perhaps it's easier then I think. I have a simple network with a pc connected to my modem/router. On this same router there is also a phone (Siemens DX800a) connected. With this phone came some software: Gigaset Quicksync. I installed this software and it works fine. I can call a number via the pc and when I receive a call a popup appears (see image) on my screen with caller details. So Gigaset Quicksync somehow listens to a network port (the address of my phone is 192.168.1.175). However I would like to built my own program that contains more possibilities and also detects incoming calls and of c…
Last reply by Leade, -
-
Who's Online 0 Members, 0 Anonymous, 16 Guests (See full list)
- There are no registered users currently online