Hack Forums
[.NET] [Solved] System.SR' is not accessible in this context because it is 'Friend'. - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] [Solved] System.SR' is not accessible in this context because it is 'Friend'. (/showthread.php?tid=3550378)



[Solved] System.SR' is not accessible in this context because it is 'Friend'. - Mr. Sultan - Jun 14, 2013

Solved thanks to Temploit


[Image: 6924c467cab00c13f7dc5ac4bc6bdcca.png]


* - Temploit - Jun 14, 2013

Why not
PHP Code

<?php 
Dim NewestVersion 
As String =  System.Net.WebClient().DownloadString("<link>") 
?


* - Mr. Sultan - Jun 14, 2013

(Jun 14, 2013 06:23 AM)Temploit Wrote:  Why not
PHP Code

<?php 
Dim NewestVersion 
As String =  System.Net.WebClient().DownloadString("<link>") 
?

Heres the link I'll put to download the exe?


* - Ignore. - Jun 14, 2013

Try this

Code
Option Strict On
Imports System.Net

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  Dim Data As String

  Data = GetPage("http://www.google.rs/")
  If Data <> vbNullString Then
    If InStr(Data, Application.ProductVersion) <> 0 Then
    MessageBox.Show("You are up to date!")
    Else
    MessageBox.Show("New update is available!")
    End If
  End If
    End Sub

    Private Function GetPage(ByVal Url As String, Optional ByVal Proxy As String = Nothing, Optional ByVal TimeOut As Integer = 4000) As String
  Dim Request As HttpWebRequest

  Dim Response As HttpWebResponse

  Dim ProxySrv As New WebProxy(Proxy)

  Dim Reader As IO.StreamReader

  Try
    Request = DirectCast(WebRequest.Create(Url), HttpWebRequest)
    Request.Proxy = ProxySrv
    Request.Timeout = TimeOut

    Response = DirectCast(Request.GetResponse(), HttpWebResponse)

    Reader = New IO.StreamReader(Response.GetResponseStream())

    GetPage = Reader.ReadToEnd()

    Response.Close()
    Reader.Dispose()
  Catch ex As Exception
    GetPage = vbNullString

    MessageBox.Show(ex.Message)
  End Try
    End Function

End Class



* - ident - Jun 14, 2013

I suggest you Ignore. that post from ignore.