Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checking value of URL

Status
Not open for further replies.

zerkat

Programmer
Jul 12, 2007
103
US
Hi,

I am new to VB.Net and am trying to do a simple thing. I would like to check the URL of a website and if it returns one value set a file path. If it returns something else set the file path to something else.

So far I have this code:

<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public NotInheritable Class HttpRequest

Public myFilePath As String
Public ReadOnly Property FilePath() As String

Get
Return myFilePath
End Get

End Property
End Class

Not sure if I am even off to a good start here. I don't know how to output myFilePath to make sure this is the member I need or if I need to use something else. Any help would be appreciated. Also, if someone could recommend a good vb.net resource for beginners I would really appreciate some suggestions. Thanks.
 
ok - i figured this out in case any other .net newbie needs it.

Protected Sub Page_Load(ByVal sender as Object, ByVal e as System.EventArgs) Handles Me.load

Dim Path As String
Dim serverURL = Request.URL.ToString
If serverURL = " Then
Path = "../someDirectory/someFileName.aspx"
Else
Path = "someDirectory/someFileName.aspx"
End If
End Sub

I still would appreciate any advice any one can give on good resources on vb.net, sites, books or whatever. thanks.
 
I read your other post, and coming from a ColdFusion background, there are going to be two things to keep in mind. The first thing is going to be learning how to develop in Microsoft ASP.Net. There's concepts here you will need to learn that apply to ASP.Net--regardless if your language of choice is C# or VB.Net (or whichever other languages can do ASP.Net). The second thing is learning the syntax of the language of your choice, such as If/Then/Else statements as you've shown above.

After a while, you'll be able to see an example or read a book in C# and understand what that means and apply to it to VB.Net. So the language itself is just the syntax--it's not as important as the concepts of the .Net framework and ASP.Net and ADO.Net, etc.

It's been a while since I've read a beginning .Net book, so I wouldn't know what to recommend, but maybe it would be worth it to take a look at some of the .Net Express Edition tutorials. Here's a link:

As far as these forums are concerned, if you have questions for the VB.Net language and syntax, this would be the correct place to post those. If you have questions that have to do with ASP.Net and .Net web development concepts, then the ASP.Net forum here is the better resource for that. You'll even have questions about data access or multi-tier design which could apply regardless if you're developing for the web or not. Those questions usually get good answers here as well.
 
Thanks RiverGuy. I'll definitely check out those tutorials.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top