I'm trying to enumerate the directories and sub directories in a Windows Form using a Tree View. I can view the directories but when I want to see the files in the sub directories I only see the files from the root.
Is there any way to use a common RESX file for a few of my ASPX pages?The default naming convention seems to be NameOfWebPage.aspx.resx so it seems like there is a 1 to 1 mapping...
However it would be REALLY convienient if i could make a few of my ASPX pages all use the same RESX page, because they are mostly using the same strings and its stupid to have a separate RESX for each page.
I know about GetGlobalResourceObject() but my application is very big and it doesnt make sense to make the strings global when they are really only needed for these few pages.
I want to add folders to keep things organized in App_LocalResources. Because when adding a lot of resorce files for different languages in this folder, files are getting messy. I added folders like
FYI : Actually what I did is working. I mean the way I mentioned above is the correct way. The reason why it wasn't working is something else so you can define your folders and the resource files above.
My web-application project (not "web-site" project) is translated to 15 different languages using the ASP.NET's built-in resource engine - which means I have tons of *.aspx.resx files in the "App_LocalResources" folder.All these resources are precompiled by ASP.NET when I first launch the application and it takes a lot of time. I mean A LOT. 5-10 minutes. I have to wait 5-10 minutes every time I make some tiny change to my code, just to see how it works.Is there any way to pre-compile these resource in Visual Studio? Changing the "Build Action" for all these resx-files to "Embedded resource" does not work :( (or I'm doing it wrong?
This is in class file Imports Microsoft.VisualBasic Imports System.IO Imports System.Collections.Generic Public Class FileSrch '' File Search Options Public Enum FileSearchOptions YearFirst MonthFirst DateinExtension NormalFiles End Enum Public Shared Function GetSearchcriteria(ByVal DatetoSearchwith As Date, ByVal Filename As String, ByVal FileExtension As String, ByVal SearchOptions As FileSearchOptions) Select Case SearchOptions Case FileSearchOptions.YearFirst Return String.Format("{0}_{1:yyyyMMdd}{2}", Filename, DatetoSearchwith, FileExtension) Exit Select Case FileSearchOptions.MonthFirst Return String.Format("{0}_{1:yyyyMMdd}{2}", Filename, DatetoSearchwith, FileExtension) Exit Select Case FileSearchOptions.NormalFiles Return String.Format(Filename + FileExtension) Case FileSearchOptions.DateinExtension Dim ExtensionFormat As String = (Convert.ToInt32(DatetoSearchwith.ToString("mm")).ToString() & DatetoSearchwith.ToString("dd")) '' Month in Double Digit If DatetoSearchwith.Month > 9 Then ExtensionFormat = (DatetoSearchwith.ToString("mmm")(0) & DatetoSearchwith.ToString("dd")) End If Return String.Format("{0}.{1}", Filename, ExtensionFormat) Case Else Return String.Format("{0}.{1}", Filename, FileExtension) End Select End Function Public Shared Function GetFiles(ByVal RootDirectory As DirectoryInfo, ByVal Filename As String, ByVal FileExtension As String, ByVal DatetoSearchwith As Date) As List(Of FileInfo) Dim FiFiles As New List(Of FileInfo) For Each DateOption As FileSrch.FileSearchOptions In [Enum].GetValues(GetType(FileSrch.FileSearchOptions)) FiFiles.AddRange(RootDirectory.GetFiles(FileSrch.GetSearchcriteria(DatetoSearchwith, Filename, FileExtension, DateOption), SearchOption.AllDirectories)) Next Return FiFiles End Function End Class This in Button Click Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim FileName As String ' Dim fileName As String = txtextension.Text.Trim().Substring(0, txtextension.Text.Trim().IndexOf(".")) If txtextension.Text.Contains("_") Then FileName = txtextension.Text.Trim().Substring(0, txtextension.Text.Trim().IndexOf("_")) Else FileName = txtextension.Text.Trim().Substring(0, txtextension.Text.Trim().IndexOf(".")) End If Dim extensionToSearch As String = Path.GetExtension(txtextension.Text) 'Dim Directory As String = Path.GetDirectoryName(txtpath.Text.Trim()) Dim Directory As New DirectoryInfo(txtpath.Text.Trim()) 'Dim filess As String() = Directory.GetFiles(txtpath.Text, txtextension.Text, SearchOption.AllDirectories) 'For Each fiFile As String In filess ' Response.Write(fiFile & "</br>") 'Next Dim SearchedFiles As List(Of FileInfo) = FileSrch.GetFiles(Directory, fileName, extensionToSearch, Now.Date()) 'Dim searchedFiles As List(Of FileInfo) = GlobalStuff.GetFiles(directoryToSearch, "whateverfilename", extensionToSearch, DateTime.Now) If (SearchedFiles IsNot Nothing AndAlso SearchedFiles.Count > 0) Then For Each fi As FileInfo In SearchedFiles Response.Write(fi.Name & "</br>") Next Else Response.Write("No files found") End If End Sub
Now,we need to address the following things in that to complete req, 1) If I enter filename_mmddyyyy.txt it should fetch only files having current date in their name in mmddyyyy format.For eg. If I give test_mmddyyyy.txt in txtextension it should return only files with test_10222010.txt and not thee ones with yyyymmdd and all...Right now I am getting all the files created in the current date including the one with ordinary test.txt and also test_20101022.txt .......And the third thing filename.mdd everything is getting passed correctly but it is not fetching the file ..Again test,test_20101022.txt everything comes.It shouldn't be like that it should only fetch files with .mdd (current date)....
In my above code i have two text boxes one for file path and other one for getting extension and also for gettting file names with diff search criteria.....What i do is i should implement file search which is like as mentioned below -
1) it should search for all files if i enter *.*,only jpg if *.jpg, and files like nks.txt if i enter ?
2) if i enter the filename alone without extn it should return me filenames that exist without extension in directories. 3) the final thing is the date in filename where my file will be like filename_mmddyyyy.txt or filename_yyyymmdd.txt or filename.mdd.In first case it should return only files with current date in mmddyyyy format and txt extn....like taht....last case is mdd in extn...
where if i enter filename.123,it sould get me files with jan 23(23 currnt date) and for months greater than 9 it is N for nov ,D for dec and so on.But in m,ytext box i will enter only file.mdd only .and also filename_mmddyyyy.jpg like that....
My asp.net web application knows how to create sub-applications (asp.net applications with web.config file, located in sub folders of the root application).
Now, I need to configure each sub-application in the IIS with a Virtual Directory, AND, make this new virtual directory an application in a specified application pool.
I just got a windows vps setup at a hosting company and about to install a big web application that is a store front. Do I need to set any of the folders as virtual directories? I'm so confused on all of this. Do I just copy the folders and files over and thats it? It has Plesk to use for the control panel. I know I have to set the directories to run as application but is there anything else?
I am using uploadify along with ASP.NET to upload files to my server. At the moment I have to recreate the folder structure and upload the images in batches per directory.Does anyone know of a way of using Uplodify or any other tool that would allow me to select a folder and upload the entire directory?
I have installed VS2010. already i have VS 2005 and website working with framework 2.0.After installation, now I am unable to set ASP.net version for IIS virtual directories to Dot net Framework verion 4.0.How can i set virtual directories Dot net Framework version 2.0 to 4.0?
I need to setup a file handler to route with multiple sub directories something like tihs;
http://localhost/images/7/99/786936215595.jpg
I tried putting this in the global.asax file;
routes.Add( "ImageRoute", new Route("covers/{filepath}/{filename}", new ImageRouteHandler()));
I am using the ImageHandler found in this Question, which works great if you have a single sub-directory (ie '/images/15/786936215595.jpg') but fails when you have multiple directories.
I tried setting up a wildcard and that didnt work (ie 'new Route("covers/{filepath}/*/{filename}"')
This is serving images from a large NAS (think something like 3 million images) so its not like I can just move files around.
In a MVC2 project I moved a file from App_code to Content folder, compile it. Then move it back again to App_Code and then changer its Build Action to "Compile". Now I get this error and I don't know how to fix this to make my program work again:
CS0433: The type 'Helper' exists in both 'c:Users...AppDataLocalTempTemporary ASP.NET Files oot00d4b7d2553f9cApp_Code.zowyklar.dll' and 'c:Users...AppDataLocalTempTemporary ASP.NET Files oot00d4b7d2553f9cassemblydl35c6d353719f85663_cde9cb01MyProject.DLL'
I wanna serve my application in ISS to be accessed from many different URL's on my web server.
eg.
http://example.com/test1 http://example.com/test2
Both these URL's get served by the same application.
I do NOT however want to just create new virtual applications to the application, because it stuffs up the user membership roles. The users and their roles must exist accross the two URL's.
In my ASP.NET app, I'm attempting to add another directory to be have the DLLs in it shadow copied.
The only method I found that will allow m to do this is AppDomain.CurrentDomain.SetShadowCopyPath.
However, this method is marked as Obsolete. MSDN has this to say about it
SetShadowCopyPath(String path) Message: AppDomain.SetShadowCopyPath has been deprecated. investigate the use of AppDomainSetup.ShadowCopyDirectories instead.
However, the AppDomainSetup.ShadowCopyDirectories property doesn't seem to change whenever I set a value to it.
AppDomain.CurrentDomain.SetupInformation.ShadowCopyDirectories = "mydirectory;bin"; string test = AppDomain.CurrentDomain.SetupInformation.ShadowCopyDirectories; // returns bin, which was the original directory
Is there a reason that it won't change and is there a work around?
I have a website that contains control panel section in saperate folder, Admin. There are 2 login pages, one for root directory (appl for end users) and one for admin directory. I define authentication and authorization in root web.config. It works for root dir. But when i add web.config for Admin dir it gives me build error "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level". Note: I have not added application as virtual dir in IIS. I run it from File System ie by using port no with localhost -http://localhost:xxxx/mysite/
I have this code and I'm getting an IOException and can't figure out what the problem is. I'm trying to loop through the subdirectories in a directory and list all of the .JPG files.
Is it possible to look into multiple virtual directories, using a single web application?
I'm trying to develop a web app; which can create a site, save this site to a virtual directory in the same server, and make changes (i.e. add/edit webpages).
The web app will handle multiple domain names (IIS will handle the bindings going into the single web app), which are routed by the web app to their respective virtual directories.
We have a web portal product from which we customize portals from customers. We use the precompiled web app and create a virtual directory (vd) where the customization resides. In addition to this we do some changes web.config in the web app folder. We would obviously like to keep these customizations under TFS source control.
When I try to add the precompiled web app (which I don't want to add to source control), a warning tells me that the vds cannot be added. If I only add the folder that is referenced to by the vd, I lose the references to assemblies in the precompiled web app.
My questions are:
How do I structure a solution for adding IIS (sub application level) virtual directories and still retain the references to assemblies? Is it possible to add other directories/files from the web application level (like App_Theme, web.config etc.) to the solution?
Since we already use Visual Source Safe, we have established a tree structure for each customization project:
Project Root | |-Custom Sql | |-Custom Portal Files (which is added as a virtual directory) | |-Other Customizations
I could probably do a lot of this manually through the source control explorer, but I'd like to have everything done through a solution.
I've followed the instructions using this article: [URL], but this doesn't address the exact problem that I have. Oh, and we are currently using Visual Source Safe for portal customizaton, but are eager to make the move to TFS.
I am developing a web site where there are two groups of users: sponsors and members. I would like each group member to login based on the group they belong to, but through a different login page. It turns out that I cannot add two separate 'loginUrl' elements to my web.config file, so how would I workaround this?
I wanted to use: loginUrl="Members_Login.aspx" and loginUrl="Sponsor_Login.aspx"...
I have an ASP.net master page. In this master, I have all my css and javascript files defined. I also have a few images and a few buttons and hyperlinks.All the urls are all declared as relative ie "/scripts/ian.js"Everything works fine if this site is the root website, but I need it to work in a virtual directory.My problem is when I place this website in a virtual directory under a root site, all my links are pointing to the root site. so my links point to www.root.com/scripts/ian.js but it should be pointing to www.root.com/virtualDir/scripts/ian.jsI thought the Base Href tag in the header would help, but so far it does not seem to be helping in anyway. All the links are still pointing to the root website when i hover over them.
i have different number of directories containing files and i need to have hyperlinks so that user can download files to their ends. problem is that these directories are outside the application directory. how to map these files paths and name so that when user right click and save it on his machine or just clicking it..... what i have to do beside setting permission to reading those directories..
We upgraded the ASP version in IIS to ASP 4 and now experiencing an odd issue with password protected directories. The directory uses a Web.config file that only allows a single login to access the directory. This worked fine until we did the upgrade to ASP 4. Now when the user logins in, it recursively prompts them to login. If the user hits cancel, they are able to access the page like normal. Is this a ASP 4 or IIS bug?
I have a collection of files with fully qualified paths (root/test/thing1/thing2/file.txt). I want to foreach over this collection and drop the file into the location defined in the path, however, if certain directories don't exist, I want them to great created automatically. My program has a default "drop location", such as z:/. The "drop location" starts off empty, so in my example above, the first item should automatically create the directories needed to create z:/root/test/thing1/thing2/file.txt. How can I do this?
I have one asp application. When i deploy this application in iis like www.xxxx.com , my index page is in the sub folder like root/home/index.asp , so when i set this as default document , browser will redirect to this url. But without redirection is this possible to load the default document in www.xxxx.com
I need my default document while browsing www.xxxx.com without redirecting to www.xxxx.com/home/index.asp