Can't Access Classes From Different Files In Website
Jun 9, 2010
I've inherited a VB.NET website and it won't compile because the class1 in the file class1.vb refers to class2 in a file called class2.vb. I get the following error when trying to compile[code]...
I am trying to access my website and display the .mp3 files in a certain directory. Through this, i want to have windows media player play the selected file. Either through list box, or combo box. I have tried many different ways. How in the world am i supposed to do this? I do not just want to set the windows media player url to a certain file, like i said, i am trying to get to select the file (in some sort of dialog box) and play that.
I'm developing a new functionality for web site project with VB.NET default language in VS 2008. As my preferred language is C# I create subfolder for C# code in the App_Code folder and add appropriate codeSubDirectories element to web.config file. The problem is that I can't refer VB.NET classes in my C# code. All VB.NET classes and structures are placed in global namespace in the App_Code. But even if I place some VB.NET class in the same namespace I've use for my classes in C#, I still can't use them.
I'm using MS Visual Basic 2010 Express. The project requires me to refer to a class in another file, which is all well and fine, but it tells me that "Length" is not a member of the file class "Rectangle", when it plainly is. And it's only "Length" and "GetArea", not any of the other variables I refer to. I would've tried to look it up, if I even knew what I was looking for, but this problem has stumped me! I'll add the snippet of code that I'm trying to refer to the "Length" and "GetArea" with, as well as the parts of code that those two are in the "Rectangle" file.
'displays cost of sod Dim floor As New Rectangle Dim dblPriceSqYd As Double
[code]....
As you can see, it's obviously there. The code for the "Width" is exactly the same as the "Length" with a few name changes. My problem here is: I can't figure out why it's having trouble calling those two, when it calls the "Width" just fine. I've tried changing around the names, and nothing seems to work.
In Java you can store a class in a separate file and instantiate it from a method in another file as long as the class file is in the same directory but this doesn't seem to work in Visual Basic.
I have an application in vb.net thats part of a big app. My team member requested I create an object with constructors to allow him to be able to access my classes and functions from his C# code and I will still be able to work on my checked out version.
I have Form Class A, which is the "Main Form". An Event fired by Form A instantiates Form B, and sets Form A as it's owner. (which makes it be on top of FormA at all times)[code]...
I have the following projects: TradingProject (my code) Has reference to TradingLibrary, and to ApiLibrary? TradingLibrary (my code) Has reference to ApiLibrary ApiLibrary (3rd party code)
I'm making several projects (like TradingProject) that communicate with a software through use of an existing ApiLibrary. But I want to push generic methods into a library I write: TradingLibrary.
Still, I would like to use some parts of the ApiLibrary directly from TradingProject. However, I then would need to pass an object (of an ApiLibrary class) into a method in TradingLibrary. Where the object should be recognized. However I assume this will be a problem, as TradingLibrary use it's own reference to ApiLibrary, so it will not be recognized as the same classes? Is there some way I can "forward" the ApiLibrary reference from TradingLibrary to MyProject, such that they will use the same reference? Or do I need to duplicate the classes and inherit from ApiLibrary for each class? Like:
NameSpace TradingLibrary Public Class SomeClass Inherits ApiLibrary.SomeClass End Class
I guess that would work, if I do it for all classes I need, but is there perhaps some simpler way I'm not aware of?
I have both Visual Basic 2005 and recently downloaded Visual Web Developer 2008 (Express Edition). In VB 2005 I cannot work on my website without reveiling my password (no encryption). This is also true with the Web Debeloper 2008 and it seems it will only work on sites Created with FrontPage. So my question is what do I need to upgrade to in order to work on my site without reveiling my password (encrypted access) or working in FrontPage.
I'm writing a WCF-Service and I split up my service class to multiple partial class files, so every ServiceContract-Implementation gets its own file. I have one file however that should contain e.g. members that are used by every partial class file such as a logger. The service is hosted with IIS 7 if this matters in any way.
[Code]....
The code compiles fine, but at runtime I get an BC30451: The name m_Log is not declared Error (Don't know the exact words for it. I get a german message ;) ). I don't think it has something to do with the type of m_Log or a depending assembly because I get the same error if i try this with a String. What am I doing wrong? How can I make this work? Edit: I was trying the same thing in a simple console application without any problems. :(
My VB project is large enough that it requires several files. It was originally developed as a Console App and I created each file as a MODULE. All modules could use subroutines, data structures and constants from other MODULES and everything worked fine. I needed to add basic windowing to the app and this required that the app be converted from a Console App to a Windows Forms App. The main window is Form1 which is not a MODULE but a CLASS. The problem is that some MODULE based functions cannot access subroutines, data and constants that are defined within the CLASS Form1 unless they are incorporated into the CLASS file and this makes the CLASS file very large. If I add a new Class file to the project, it also cannot interoperate with Class Form1 in the same way that multi-MODULE code interoperates.
How does one spread CLASS code across several files and still allow it to interoperate as if it were in a single file? Alternatively, how does one create several CLASS files that operate the way multiple MODULE files operate.I am sure that there are all kinds of best practices that I am violating but the goal to to get some prototype software working and interfaced to some lab equipment.
My software handles multiple operations on files, and I have now finished writing the related functions, using the System.IO classes. I now need to add support for network drives. Using a mapping works very well (although Directory.GetFiles is a bit low, and I don't know why), but I'd now like to be able to deal directly with paths such as \192.168.0.10Shared FolderMyDrive. Is there any way to handle this type of paths other than mounting the drive to an available drive letter, using the newly generated path, and then unmounting?
I want to make a program that scans a website to find an extension (.png), then tells me all of the files with that extension on the server.Which displays them in a list box. so lets say the website is
[URL]
and i need to find the files, but file browsing is off on the server.So I pretty much need a web crawler. How can i do this?
I was working on a project lately where my manager asked me to develop a vb application that can download files of the website [url]...
i was thinking if i can make a form that display all downloadable files on the website with a checkBox next to every file so that the user can check which files he wants to download and proceed.
I'm new to Visual Basic so im wondering if there could be made a program when it opens it connects to directory of my website and ouput the files, so you can see them, delete, download etc.
Can i write 2 classes for one Script Task editor in SSIS(2008). I tried to access the global variable like below. I created 2 classes and it doesn't show any compile error, but i couldn't access the global variable in class2 which was assigned as 2 in class, ScriptMain.
I need to download serveral years worth of files from a web site, the web site posts files daily in "Date".csv. How do I write the code in vb.net to get the string value for the dates? I know that you can do something like : Dim start date = #11/01/2009# and Dim end date= Now.
How do I get these values so I can incorportate them in a string? And then loop through each value.
It will need to start with the first date an download that file, then loop through all the dates downloading each file until it has reached the end date. I already have the code written to extract the info i need from the document and import into a sql server, my only issue is the date range string issue
So, in this program I added 2 necessary login codes let's say, first a code that I will provide and then the username and password from my website. I implemented both ways, the first one worked perfectly, however, the second one is giving me some problems, my idea for that control was not using a database of users, that was going to be too complicated for a 14 year old guy, so I decided to take the source code for my website and I took a fragment, the boxes for the login, username, password, forgot your password, remember me and some other boxes, great, that worked perfectly, I uploaded the HTML modified document to my website's files and linked it to the URL of the webbrowser control in one new form, good, it's working, but I wanted a simple condition that works for this function "When the webbrowser loads the success website, hide me and show the past login form, when this one shows the failed login, popup a messagebox that says the error.". I have been looking for that simple condition for a long time. I am using Visual Basic 2010 Express Edition.
I have no idea how to do this, using a webbrowser in VB(the normal one or, micorosoft webbrowser?)or can this be done using a Webrequest or webclient in VB.net.[code]...
All I want is the website Im trying to visit to think that I visited it with this proxy's IP.I know this is possible because ther are websites where you only type the URL in a textbox and it starts surfing for you like("planetmuffin.com"). How can this be possible on a website and not on Vb.net?
I have a website in intranet and I wanna to block a remote access or VPN access to the site.I waana to know how is users use remote access or VPN to access to my site.
Im trying to access(just as if I really visited that website) using a proxy, so that my real IP doesn't display for security reasons. I have no idea how to do this, using a webbrowser in VB(the normal one or, micorosoft webbrowser?) or can this be done using a Webrequest or webclient in VB.net.
So far I used this code and I dont think it works?:
Code: Imports System.Net Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
[Code]....
All I want is the website Im trying to visit to think that I visited it with this proxy's IP. I know this is possible because ther are websites where you only type the URL in a textbox and it starts surfing for you like("planetmuffin.com"). How can this be possible on a website and not on Vb.net? It is not neccesary for me to see the website, as long as it thinks I visited it!
I know it should be possible because Ive seen music downloaders in which you can use a proxy for the download.
I've been working on a website with database access in ASP.NET, VB.NET and SQL server for a University project. I've been able to build and test all my forms and they all work as they should so now has come the time to submit my work on a CD. I've been told that I have to explain to my Lecturer about how to open the files/project but I went to test that the default page opened (using Firefox), but unfortunately they won't open and I get the following error: XML Parsing Error: not well-formed Location: file:///C:/Users/NAME/Visual%20Studio%202010/WebSites/FOLDER/Default.aspx
Line Number 1, Column 2:<%@ Page Title="Home Page" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="false"-^
Is there any way that I can get the files to open from the CD (obviously after amending the file locations in the code) in a web browser? Would making a extremely simple HTML page with a hyperlink to the ASPX page work, or would it require "building"/"compiling"?I've been using Microsoft's Visual Studio Web Developer 2010 Express to write and build my code and the pages then open in Firefox.
I am trying to import a bunch of excel 2003 files all with A:H columns and they are under the same headings etc. into a table in access 2003 database. This is a module in access im making. Im using a file search to look for every file that begins with Format (which they all do ) to get at all the files in the folder path. is there a more efficient way to do this? somehow select all files in a folder? and import each to the same table in access? The DoCmd.TransferSpreadsheet seeems to take each file path individually so I'm not sure how to get each file name in the folder to import it.
I have this at the moment:
Sub Import() Dim db As Database Set db = CurrentDb
Ok I know this question has been asked to death but I still have not seen a good answer. I have created an application in VS2010 using VB.NET. In my application I have an error log that is an XML file located in the Public gstLocalErrorLogLocation As String = Application.StartupPath & "ErrorLog"that gets written to in the event of an error so I can trouble shoot application easier. My application also downloads files from our FTP site and puts the files in Public gstLocalDownloadLocation As String = Application.StartupPath & "download"So I have files that get read and written to as well and created and deleted all in the Application.StartupPath which is either "c:Program Files(Application Directory)(Some Directory)(Some File)" or "c:Program Files (x86)(Application Directory)(Some Directory)(Some File)" depending on 32bit or 64bit Windows 7.
After creating the setup I install it on my test machine that have both Windows 7 32bit and 64bit.Everything in the application works great till I have to write to, delete or creat a file in those directories above. I know it is an access issue and the UAC. This will get installed on numerous systems so the options I have seen to change file or folder permission on the computers manually is not an option.What has to happen is after I install the application it just works like when you install it on XP. Some post have suggested that you us a user with administrator privilages or group which is all fine and dandy but the user I have used to test the application has all of that.
So what I am asking is how do you create an application with VS2010 in VB.NET that after creating a setup package and installing on Windows 7 will just work with out "Access to the path c:Program Files(Application Directory)(Some Directory)(Some File) is denied." If I have to install this on 100 Windows 7 computers it has to be a concreate no manually doing anything just install and work like when we installed on XP.