|
You need to provide more detail, such as what the filenames look like, and what the delimiters could be.
|
|
|
|
|
Easiest way will be either to use string.Split on the file name (if the delimiters are sensible) or a Regex:
For example, if the file name was "2012-12-31 Oranges (Jaffa Co, John Smith).xlxs" The I would use a regex:
(\((?<Company>.*?),(?<Contact>.*?)\)) Would match it and extract the company and contact as separate fields.
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
The file name would look like the following:
C:\\app1\12_2012\customer name_contact name.xls.
The part of the file name I listed above is the following:
customer name_contact name.xls.
The customer name can contain all kinds of special characters like (,),'. Thus I need to be able to parse out the customer name with all the special characters.
Note: It is my idea to have an underscore between customer name and contact name for the following reasons:
1. I need some kind of a delimiter,
2. I do not think alot of people's name have an 'underscore' as part of the name.
3. The underscore is a valid character for a filename.
Note: these names may like like the following if it is entered incorrectly by a user:
customer name _ contact name.xls.
Thus can you tell me how you would parse out the names in that case?
|
|
|
|
|
Try:
<pure lang="c#">
string inp = Path.GetFilenameWithoutExtension(path);
string[] parts = inp.Split('_');
parts[0] is the company,
parts[1] is the contact.
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
|
Hello,
I have a .props(Project Property File), which is currently executed using a bat program(?Windows Batch File).
I want to rewrite this using Asp.Net.
How do you call a props file in ASP.NET, console application?
This is just one part of the program, which is being completely re-written in asp.net from asp.
Thanks!!
|
|
|
|
|
The same way you execute a batch-file, using the Process class.
|
|
|
|
|
Thank you!
Kind of new to asp.net.
Do you know where I could a list of all the classes avaliable in .Net?
Thanks again!
|
|
|
|
|
vanikanc wrote: Do you know where I could a list of all the classes avaliable in .Net?
Assuming the BCL (Base Class Library), it's documentation can be found on MSDN[^]. You could create this list using code by using "reflection". Search this site for examples
|
|
|
|
|
I ran this app after 2 week and I encountered this error.....Kindly tell me how to resolve this error
System.Runtime.InteropServices.SEHException was unhandled
Message=External component has thrown an exception.
Source=System.ServiceModel
ErrorCode=-2147467259
StackTrace:
at System.ServiceModel.Diagnostics.TraceUtility.SetEtwProviderId()
at System.ServiceModel.ServiceHostingEnvironment.EnsureInitialized()
at System.ServiceModel.ServiceHostingEnvironment.OnEnsureInitialized(Object state)
at System.ServiceModel.AspNetPartialTrustHelpers.PartialTrustInvoke(ContextCallback callback, Object state)
at System.ServiceModel.ServiceHostingEnvironment.SafeEnsureInitialized()
at System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at System.Web.HttpApplication.ApplicationStepManager.ResumeSteps(Exception error)
at System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
at System.Web.HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
at System.Web.HttpRuntime.ProcessRequest(HttpWorkerRequest wr)
at Microsoft.VisualStudio.WebHost.Request.Process()
at Microsoft.VisualStudio.WebHost.Host.ProcessRequest(Connection conn)
at Microsoft.VisualStudio.WebHost.Host.ProcessRequest(Connection conn)
at Microsoft.VisualStudio.WebHost.Server.OnSocketAccept(Object acceptedSocket)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
InnerException:
Please help urgently
|
|
|
|
|
The SEHException class handles SEH errors that are thrown from unmanaged code, but that have not been mapped to another .NET Framework exception. The SEHException class also responds to the HRESULTE_FAIL, which has the value 0x80004005. (Source here[^]).
It'll be impossible to say what goes wrong without seeing the actual code. And no, it's not urgent here; we're volunteers.
|
|
|
|
|
Thanks Eddy, I can not study more about the constructors and their properties and many more.
But the problem is that I was working on this particular project, then I went on break for 2weeks. When I got back to work, I now experienced this Exception. So I'm wondering what could be the challenge. cos the the program was working perfectly ok before
Thanks for ur support
|
|
|
|
|
Chris-ahams Njikonye wrote: cos the the program was working perfectly ok before
Code is always executed in the same way; if nothing changed, then one can expect the same result. If the result changed, something else must have changed too. If it's not the code, then see which "Automatic Updates" have been installed.
Further, the exception will be thrown at a specific location. You could take that constructors' code and post it here. Being a generic exception, it's impossible to tell what's causing it without debugging.
|
|
|
|
|
Thanks alot Eddy...I have learned alot from the experiences you have shared wit me. Now, I observed that when I run my Visual Studio IDE I don't get the SEHException error message again. Everything runs successfully. But my login to the application is disable; I cannot access the database again...
I will be sending the page code to you
Kindly help
|
|
|
|
|
Chris-ahams Njikonye wrote: Everything runs successfully. But my login to the application is disable; I cannot access the database again...
That's a weird side-effect. Any exceptions? Can you login to the database manually?
Chris-ahams Njikonye wrote: I will be sending the page code to you
It's easier to post the relevant code here, using PRE tags.
|
|
|
|
|
Hi,
I am developed a windows form application. I need a API for file repository. I will need archiving around 50000 files (word document, e-mail, images).
I need that controls the checksum file in the case of the files are same.
Do you know some API in c# for this project?
Regards
|
|
|
|
|
|
Hi All,
I have a dropdown with two options."All" and "Selected". "All" is the default value. In selected index_changed event , when i changed to second option, it is hitting , but when going back to "All" ,the event is not firing. Drop down's viewstate and autopostback properties are true.
Thanks
Rk
modified 4-Jan-13 21:53pm.
|
|
|
|
|
I think your question is imcomplete
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
I think you have forgotten something there, like the subject and question,
|
|
|
|
|
|
This post will soon be removed if you don't correct it.
|
|
|
|
|
Hi,
I would like to know how to develop a auto text complete application, which will provide autocomplete word feature for all word processors, web applications etc.
Please see this software. www.etype.com
This is how i want to develop the application.
Thanks!
|
|
|
|
|
AutoComplete TextBox[^] is one link which offers an auto complete solution. There are many more articles that could help you do this - just do a search in the articles section on this website.
|
|
|
|
|
Thanks Abhinav. Yes. I want that autocomplete feature to be integrated with all word processors, like microsoft word, excel etc, notepad, textpad etc. Even though, these word processors offer in-built autocomplete function, i want to integrate my custom feature with it. that precisely is what i want to know, how to implement it?
|
|
|
|