.net Equivilant To Php's Require()
Dec 22, 2010
I have a list of functions that I'm using throughout my .net application. Is there a way that I can include a file into the pages that require the functions without having to copy and paste the functions to each individual page?
The large majority of pages I've found on MSDN are either toward people who are already familiar with .net to those who have never programmed before and just starting. I haven't been able to find one for people who are versed in programming and just need a list of functions and methods.
View 15 Replies
ADVERTISEMENT
Apr 7, 2011
I am having an issue using the vb equivilant of the MAX lambda expression. at foos.Max(function(x) x.id) when I try to intellisense the property ID VS will not show it. But when i run the example it works. Is there something I am doing which is wrong, an i am just lucky it runs? [Code]
View 1 Replies
Oct 31, 2011
I'm trying to add a handler, but as soon as I'm targetting a method that has parameters, the handler fails. This is the simple code:
AddHandler App.Current.RootVisual.MouseLeftButtonUp, RootVisual_MouseLeftButtonUp
Private Sub RootVisual_MouseLeftButtonUp(ByVal sender As Object, ByVal e As MouseButtonEventArgs)
[code]....
View 1 Replies
May 20, 2011
Never before did i realize the neccessity to scrap the User Account Control, other than for reasons it was simply annoying, until i became a developer. I have an application that does nothing more than remove and create files within its own directory. Are you telling me every application that creates local files require admin rights? Surely something is wrong here. Can this not be circumvented? How do other developers overcome this issue?
[Code]...
View 1 Replies
Dec 19, 2009
If I wrote some software that used an access database to store data. If I then gave the code to a third party, who ran this sofware on his Pc. Would the code work , if his Pc did not have the access database installed.I read in some article that this would still work? If this is true, how could this work? If the above software had an form which required the client to input details of an order. When the order details were being processed by the code where would it store them if no access database was installed on that pc.
View 17 Replies
Dec 29, 2010
I'm trying to code a spelling checker into VB.NET 2010.It'll check the RichTextBoxFindandPrint (my version of RTB) control.However the solutions on the internet require Word to be installed. [URl]..
View 26 Replies
Mar 18, 2010
i need to send e-mail's from the iis 6 via smtp server that are 2 diferent machines
i have this exampel but is not working
Public Sub SendMail(ByVal from As String, ByVal [to] As String, ByVal subject As String, ByVal body As String)
Dim mailClient As New SmtpClient(test.MailServer)
[Code]....
View 4 Replies
May 9, 2012
I've stumbled upon this code:
var knownSeparators = new[] { "\", "/", "|", "." };
return knownSeparators.FirstOrDefault(path.Contains);
where path is a string and the return value should be a string as well.
Allthough path.Contains' intellisense suggests a parameter, it works fine without one.
How does this work exactly? Is there any way to copy this behavior in vb.net?
View 1 Replies
Nov 1, 2010
My application seems to require .net framework 4 to run. Hence not working on standard XP installations until .net 4 is installed. How do I make it so that it only needs 3.5, or whatever XP uses natively?
View 5 Replies
Nov 22, 2009
I am trying to create a setup deployment file, but some dll files require dependencies to be identified.
View 1 Replies
Dec 21, 2009
Make program require a registration number to run?
View 4 Replies
Aug 15, 2011
For my user system, I require each user to have a unique id. The reading in and saving of the user data is all done, but now I'm focusing on adding new users. In my add user dialog, I have the information fields required to create a new user, one of which is the ID (which must be unique). For this I have created a function that I thought would always give a unique id but it does not. paste the code below:
Function getnextuserid()
Dim id As String
Dim unique As Boolean
[CODE]...
View 2 Replies
Jul 9, 2009
Is there any way to use VB 2008 to create an app to work on a computer that does not require .NET 2.0+? If there is no way to install .NET on the target computer, is there any way to write the app in such a way that it works on the computer?
View 12 Replies
Mar 13, 2012
I have an application written in VS2010 that targets FW2.0..It has no dependencies other than the framework.The application runs fine on the local drive.But one user tells me that he already had FW2.0 installed but had to install FW2.0 SP2 in order to get the exe to run if it was placed on a network/shared folder? Why would running from a server/shared folder make the application crash if Sp2 wasn't installed? some network/path error that was was fixed in SP2 that doesn't affect the app when running off the local C drive ?
View 1 Replies
Jun 20, 2011
how I can deploy my .NET applicationwithout the user having to install the program.i.e. In VB6, I could just create a executable file which did not require the user to install anything, they would simple run the program.
View 6 Replies
Dec 11, 2009
I'm starting a new project; trying to be more strict than previous ones. I've set warnings as errors in the build I've added FxCop to PostBuild. The one last thing on my list os require people to add inline docs for all classes/non-private methods/properties.
View 2 Replies
Dec 7, 2009
I have the code
[Code]....
Then while the box pop up I click No button, the program should exit sub but actually it is not. The code looks stick somewhere else. hat I found is that PHP
[Code]....
View 2 Replies
Dec 28, 2010
Almost every site have to login to see more the pages of the sites Now my problem is I can not get the source code of sites require login... So my question is how can I connect to site and get the source code (link requires login)
View 8 Replies
Apr 8, 2012
VB.net 2010 windows forms application:Why does the compiler compile with code that requires subsequent alteration?
For example, in the form sub InitializeComponent():
system.Windows.Forms.Button() requires alteration to global.system.Windows.Forms.Button()
[code].....
View 1 Replies
Sep 14, 2009
I'm in a VB.NET application. I have referenced some java.* namespaces in my file and am utilizing objects and methods from this namespace throughout the code. Presumably this is relying upon J# to compile.
Imports java.util
Imports java.util.zip
Imports java.io
Are these JDK namespaces fully contained in the .NET framework, or will my clients need to have Java installed when they go to run my application?As a side note, I have not explicity referenced any external Java DLL's or anything. This is all pure .NET as far as my code is concerned.
View 1 Replies
Mar 30, 2010
I made a little program for Hobby-use, and I like it to be installed by an installer. There's an installer program (Windows Installer 3.1?) deliverd with Visual Studio 2008 but that does not do the job completely. I want a coupling to be made between a program and a the users startup directory.If Windows Installer 3.1 can do that after all, can somebody explain how? If not, is there a free or low cost, simple to use (no scripting) installer program what will do the job? At last: Is there a version of .NET Framework 3.5 that does not require downloading during the user's setup procedure?
View 5 Replies
Aug 24, 2009
Im going to make my application require a Serial key(No clue how this works). And how do i prevent jumping messages. My friend said that there most used for getting keys and avoiding key asking.
View 5 Replies
Nov 29, 2011
I'm not sure that I'm doing the right thing here..I'm writing a user control that's supposed to be (fairly) generic. It's a bit like a modified email client specifically tailored to some of the internal things we do.
The view is composed of two main pieces, a message list and a viewer. I need this viewer to be interchangeable, so if someone wants a different style of view they can simply handle an event and change a property. My original idea was to just have an INoteViewer, but since I'm adding it to my form I also need to guarantee that this object is a Windows.Forms.Control of some sort.
Should I continue along these lines and maybe raise an ArgumentException if I can't cast it to INoteViewer, or should I go a different direction and create a class that inherits from Windows.Forms.Control?
View 2 Replies
Jul 8, 2009
I have placed a few radio buttons in a panel, but I have a weird problem where they require 2 clicks to change their state.If one of the radio buttons is checked, and I click once on another radio button, this will uncheck the checked radio button leaving no radio buttons checked. I then need to click the radio button a second time to change its state to checked.
View 4 Replies
May 8, 2009
My application (vb.net) sometimes throws an "access denied" exception when attempting to delete files in the AppData folder and I'm not sure why.I confirm that the file exists before attempting to delete it and have not done anything to make it readonly, etcThe interesting thing is that it seems to go okay when I'm logged in with Admin rights
View 2 Replies
Jun 29, 2011
I'm creating a tool that will query Excel and intialize the default settings for the site's Cad Software.I want 2-20 users to be able to simultaneously query excel. Currently I have the spreadsheet open on one computer and the other test machine gives me this error.
GetOleDbSchema Table Require an open and available connection. The connections state is closed.
I could use some help on the code design. Should I use Datareader instead....Does that have less permissions issues? Or do I need to open up the oledbconnection in a different manner?
Private Const cPageData = "PageData"
Private Const cPrinterData = "PrinterData"
Private Const cSupportData = "SupportData"
Private Const cUserData = "UserData"
View 4 Replies
Jul 20, 2009
I am trying to write a regular expression string match in vb.net. The condition that I am trying to implement is that the string should contain only alphabets and must contain atleast one letter of both lower and upper case. i.e AAA-fail, aaa-fail, aAaA-pass.
The regular expression that I have come up with is ^(([a-z]+[A-Z]+)+|([A-Z]+[a-z]+)+)$
View 3 Replies
Oct 25, 2010
I have a single table that holds my Categories
CatID, CatName, ParentID
I have often used this layout to show Root Categories where the ParentID IS NULL. I would like to be able to create a vertical Menu (using a repeater and an <UL><LI> that displays the Root Categories and ideally, a collapse panel that would expand with the subcategories. Given the above Table format, it is also easily possible to make the hierarchy unlimited.
how to make a single dataset that understands the Child relationship.
View 1 Replies
Apr 13, 2011
The problem I have is very complex and relates to an 3-rd party DLL which require hardware components and special software installs, so unfortunately, I can't post any code so the problem can be replicated. What I can do is provide a very detailed text description and ask for some opinions...
So, here goes...I'm doing a project that uses an old DLL that exposes functions that communicate with a specialized program and call these all the time. I've imported the functions using <DLLImport> tags. The functions themselves return a int > 0 if it run ok and <= 0 if it failed. Part of the problem is that only one function can be performed at a time and if several commands are activated in short amount of time, the connection to the DLL stops working and all function calls return fails. Initially I've had problems using threading with this DLL until I removed it all (some functions would not perform at all, others returned fails, etc.).
My program communicates with the DLL with no problem... All calls are normally returned and executed and everything works perfect... UNTIL the user clicks a little too fast.
So, the user has a form on which he activates these function calls, and if he doesn't wait long enough for the first call to the functions to end, the DLL connection 'fails', after which the program has to be restarted (reinstancing the class containing the <DLLImports> doesn't help for some reason?).
After a week of testing and GoogleFixing, I've tried almost everything:
1) I've made the functions calling DLLs store a bool variable Working and then wait for that to be free - this didn't help as apparently the connection breaks before even coming to the code, which suggests a threading problem (explained further down)
2) I've tried adding <STAThread> to DLL function declarations
3) I've tried messing around with <DLLImport> attributes
4) I've added SyncLock to function calls
5) I've added a loop with sleep on the calling code to make it to 'wait' for the work to end
All of these didn't help, just showed that the DLL connection fails even WITHOUT repeated calls to the DLL... So, the only thing that did help is disabling the controls starting the calling process on the form...
For example:
CODE:
This is of course a stupid way to treat the problem's symptoms (the source eludes me) and inpractical since the calls are made from about 40 different places in the code and I'd have to disable ALL forms/controls starting this calls to be fully safe, which is nearly impossible in practice.
So, entering any code already causes a problem, which is why I've came to the conclusion that this is a threading problem...
I execute all the function calls from the Main Thread (like I said, all past threading was removed due to problems communicating with DLL), yet for some reason the form keeps the focus and the user can click away (most likely because the DLL is working at the time and the form keeps the focus?), either messing around with the Main Thread or creating a new one which seems to break the DLL.
So, assuming that no one comes up with a magical one-line solution at least answering these questions would be very helpful:
1) Is there a way to fully disable control over the program to the user in a simple way while the code is executing (something like Application.enabled = false)?
2) Can Main Thread be disabled from reacting at other points in the program in some way until a code finishes?
3) How can <DLLImport> lines be restarted if reinstancing the class containing them doesn't help (I'm seeing this as a memory/cache problem of some sort, since after program restart, everything works fine)?
View 2 Replies
Mar 3, 2012
I'm just getting started with Visual Studio (2005), and my aim is to write a fairly simple application in Visual Basic that will need to store some data to disk.What I really want is to be able to send the application to the end users (xp, vista, win7) and have them just be able to use it without having down download all kinds of extras. For example I'm guessing that if I use an SQL database in my application they will need to download SQl server express or some other sql downloadable?
If so is there a similar downloadable for MS Access?I'm just in the 'seeing how things work' stage at the moment and I don't want to waste time going down the SQL track just to find it won't actually work unless my users all download SQL to their machines (which they won't want to do).
View 4 Replies