473,657 Members | 2,686 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to filter file by file name? (ASP.NET 1.0 , C#)

1 New Member
I'm writting a program for upload file to Web server

first I new a file folder name Report on my Web Server

and then new many sub file folder in the Report file folder

WebServer -- Report -- Adasa

-- Shopbop

-- RevolveClothing .... ( total have 42 sub folder under Report)

--------------------------------------------------------------------------------------------

the name of uploading file are many kind of format

such as 20070122Adasa80 802 、2239Shopbop0aa aa、20938Adasa80 291、qqqqRevolve Clothing ... and so on

I want to filter if the file name doesn't have Adasa、Shopbop or RevelveClothing ... (42 kind of key words)

------------------------------------------------------------------------------------------

how to do it?

I'm using Asp.net 1.0 c#



thank you very much
Jul 17 '07 #1
1 2197
Plater
7,872 Recognized Expert Expert
The string class has a .IndexOf(search string) function that will return a -1 if the searchstring is not found in the original string.

Example:
Expand|Select|Wrap|Line Numbers
  1. string n="Fred is fast";
  2. int a=n.IndexOf("is");//a is set to 5
  3. int b=n.IndexOf("aaaaaa");//since aaaaaa is not contained withen n, b is set to -1
  4.  
You could loop through your required strings to find a match.
Jul 17 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
6467
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the report are based on the same View addressed in the Record Source of both as 'dbo.CLMain_vw'. The View resides in a SQL Server 2000 database. There are two different problems I am having with filtering: The first involves filtering in the form by date...
1
7226
by: Michael Shutt | last post by:
We have an existing ISAPI filter that performs authentication for all pages on our web site, including pages we are now writing for ASP.NET. The filter is pretty basic, receiving the user name and password in clear text and checking them against a database of users. The filter has been in use for some time with classic ASP pages. From classic ASP pages, the application can retrieve the login name that the user entered from...
0
1887
by: Anonieko Ramos | last post by:
Answer. Use IHttpHandler. thanks Ro ry for coming up with this code. It processes css file to add variables. neat idea using System; using System.IO; using System.Text; using System.Text.RegularExpressions; using System.Web; using System.Web.Caching;
10
4242
by: Guoqi Zheng | last post by:
I know I can use http module in my asp.net project to rewrite url. However that is only true for .aspx page, there are many other static page in my application such as .htm. .asp, etc. My question is: 1. Is it possible to map all those request (.gif, .jpg, .swf, .asp, .htm, whatever) to my http module first? 2. Or in this situation, I have to use a ISAPI filter?
2
2510
by: Dmitry Duginov | last post by:
I wrote HTTP module and configured it to fire with every request to my application. In IIS6 aspnet_isapi.dll mapped as Application Extension, web.config contains the following: <system.web> <httpModules> <add name="RefFilter" type="RefFilter.RefFilter, RefFilter" />
1
3870
by: Luurs | last post by:
Hi All, I've been using a asp-label in the HTML <headsection for quite some time in order to dynamically generate meta-keywords,-description, css and js references. Though the actual HTML-output isn't that pretty (<span>'s in the head-section...) it works fine with browsers, crawlers. It never REALLY was an issue...
0
1300
by: =?Utf-8?B?SnVzdGluIFJvYmVydHM=?= | last post by:
Hi I am developing a mobile web VB asp.net application in VS 2005. The forms are mobile web forms. I have a mobile web configuration page (web.config). In one of my forms I have a DeviceSpecific control so that I can choose to use an asp:TextBox when PocketIE is detected, otherwise I want to use a mobile:TextView control. Here is a snippet of my asp code:
1
2022
by: nth | last post by:
I wan to filter the database show out information by using the user login name. Means that when that user login by entering their names n password, if correct then it will go to the other page by showing that user result only, not other user result. Can somebody help me pls?. Following is the login page code: <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!--#include file="Connections/conResult.asp" --> <% Dim Recordset1__MMColParam...
3
2659
by: franc sutherland | last post by:
Hello, I have a report which I filter using the me.filter command in the OnOpen event. Me.Filter = "OrderID=" & Forms!variable_form_name! Me.FilterOn = True I want to be able to open that report, filtered, from different forms. How do I carry the name of the current form into the
0
8407
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8837
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8512
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8612
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2739
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.