|
First can I suggest you get hold of Expresso or one of the other tools that lets you play with Regexes so you get the correct one.
I believe you are trying to insert a space in front of every upperCase character, so the simplest Regex is ([A-Z]) . Unfortunately however you cannot just Replace these as then you would end up with 76/78 agdevi t2nd lr agdevi 3
<br />
Regex regex = new Regex("([A-Z])");<br />
input = regex.Replace("76/78NagdeviSt2ndFlrNagdeviM3"," ");<br />
Instead use a MatchEvaluator. This example demonstrates named targets, which is not the simplest way to achieve what you require, but does scale better with more complex Regexes.
<br />
private string UpperEvaluator(Match match)<br />
{<br />
return " "+match.Groups["upper"].Value;<br />
}<br />
<br />
public string AddSpaces(string input)<br />
{<br />
Regex regex = new Regex("(?'upper'([A-Z]))");<br />
return regex.Replace(input, new MatchEvaluator(this.HtmlStripEvaluator));<br />
}
|
|
|
|
|
dear all,
i need to write a program (.dll or .other) in C#,
i'll use to make a query to a database (MS Access) through IE (Web)
1. I Have a database (MS Access)
2. My friend will use my site to take a string from database using parameter e.g http://mysite/grade.something?id=bryan
3. i'll use the parameter bryan to make a query to database
4. the result will be sent to my friend (he'll use get method)
5. the result must be free from HTML tags (only the result)
anyone can help me...
i realy have no clue on this
i need to write it in ASP.NET (C #)
thanks...
Alit Atmaja
|
|
|
|
|
Perhaps you should ask this question in the ASP.NET forum, then?
Seems to be a more appropriate place.
Regards,
mav
|
|
|
|
|
Yes Alit, please use asp.net forum for such queries. For this time I have the following reply:
Any Web Server based response would contain some amount of HTML irrespective of whether you are working with IIS, Apache, a .net Web Service or whatever… So you can’t have that condition.
But with asp (or asp.net) you will have enough luck, to custom format your returning HTML. So you can embed your answer in any HTML tag of your choice and let your friend know the tag name to parse for getting the answer. The rest of the HTML can be ignored.
|
|
|
|
|
Is there anyone willing to help me figure out how to get a basic restaurant program working? it uses a microsoft access database and has basic things such as showing a menu, showing an order etc. If anyone will let me email them the files so they can take a look to see where i have gone wrong it would be much appreciated.
Thanks!
|
|
|
|
|
I would be willing to take a look. I recently was working on a general quiz program that drew its info from an Access DB.
|
|
|
|
|
I am trying to create a Scheduling/appointment control that look similar to Outlook's scheduling.
I have already created most of the control and can draw appointments the way I want. The one issue I am having has to do with displaying conflicting appointments on the schedule in a way that is similar to Outlook.
Does anybody have some tips or can point me in the right direction to learn how to do this?
Thanks,
Eric
|
|
|
|
|
Hi all,
I am writing a fairly simple VS.NET addin (my first). One of the things I need to do: add an item (or a few) to the default context menu in the editor window. My guess is that I need to manipulate some member of the Commandbars collection, but I don't know which (there are about 210) or quite how. Can anyone point me to a good resource? None of the Addin examples I looked at here did this...unless I miss it...which is always possible
Thanks in advance,
Bill
|
|
|
|
|
First, be sure to read the Automation and Extensibility Reference[^] in the Visual Studio .NET documentation if you haven't already.
Second, MSDN[^] has had many good articles in the past about extensibility in Visual Studio. You can find most of them under Extensibility Articles[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Hi !
I search some tutorials for Irda programming with the .NET Framework, i want to write some application to exchange datas with my mobile phone via Irda and my laptop
Thx in advance
Alex
|
|
|
|
|
Any replacement for VB replace function in C#? Thanks. 
|
|
|
|
|
Would you mind elaborating? There's Regex.Replace , String.Replace , and StringBuilder.Replace in the .NET BCL (base class library). I recommend searching the .NET Framework SDK documentation which should be installed on your machine (installs by default with Visual Studio .NET, as by default with the standalone .NET Framework SDK).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
You can call the Vb replace function from C#.
First, add a reference to the Microsoft Visual Basic .Net Runtime componet to your project.
Then call
Microsoft.VisualBasic.Strings.Replace("123456", "234", "789");
--
Aaron Eldreth
|
|
|
|
|
Hmmmm.... The FisherPrice strategy.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
Colin Angus Mackay wrote:
Hmmmm.... The FisherPrice strategy.
Hey, I like their toys!
--
Aaron Eldreth
|
|
|
|
|
Aaron Eldreth wrote:
I like their toys
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
--
Aaron Eldreth
|
|
|
|
|
Does anyone know how to lock the keyboard and mouse?
I have a sensitive part in my code where I do not want the user to be able to do anything with the keyboard, not just in my application - nothing at all!
Just for a few seconds I want to lock the keyboard and mouse.
Thanks,
Haim.
|
|
|
|
|
Without using a keyboard and mouse hook, this is not possible on XP nor any Windows platform. You should not do this, either. If you want to disable input messages to be handled, set Cursor.Current to Cursors.WaitCursor . This disables input processing for the entire application. This is all you should do, accordingly to Windows programming guidelines.
If your application modifies system state, be sure to tell the user that and that they should wait. Give them a progress bar if possible, and nice friendly wait message.
Also if possible, make your operation atomic. Depending on what you do, you could use transactions to make sure the batch of operations fails or completes as a whole. If your performing database routines, all major RDBMS's support atomic operations. You can futher use transactions in ADO.NET using IDbTransaction implementations like SqlTransaction and OleDbTransaction , etc.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Second, I did found a way to lock the keyboard and mouse on XP (and actually every platform) which is very much supported by microsoft.
Here is the link to the msdn help page:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/UserInput/KeyboardInput/KeyboardInputReference/KeyboardInputFunctions/BlockInput.asp[^]
(or you can just look for "BlockInput" function - BOOL BlockInput(BOOL fBlockIt); - this is the win32 version of the function, the win16 version is "lockInput").
Note that I am only using it as part of my company need to make some actions on the user computer without the user intervention, when using a 3rd party application which I have no other control of except using the SendKey function to the other application window. During this time I don't want the user to accidently do some damage. This is highly rare and we are trying to avoid this situation at all cost but ironicly, sometimes this is the best way to actually raise the service quality we give to the users (and yes, we display a progress bar and a message).
Thanks again,
Haim.
|
|
|
|
|
I want to retirieve the password and name of the user who has currently logged in into the system. If possible also let me know how to retieve user details and password of the user who has currently logged into the Portal Server 2003. I am trying to integrate an application which login with the information user has provided to login in to the sharepoint serve.
Thanks in advance
|
|
|
|
|
You can't retrieve the password, unless a network administrator has stupidly enabled plain-text passwords, and that's only for support very old legacy systems. If you could retrieve the password, what's stopping a cracker?
You can retrieve the username but how you do that depends on the context. In ASP.NET if user impersonation and Windows authentication is enabled, you can use the User property you'll find on the Page class and on other classes. This retrieves the IPrincipal , from which you can get an IIdentity that defines the Name property.
Using SharePoint, this would work because SharePoint defaults to NTLM authentication (IIRC, that's all it supports). You shouldn't have to re-authenticate the user, either, so long as the authentication request is to the same domain or forest in an Active Directory network (depending on the network setup).
If you use Kerberos authentication, this authentication should be transparent as well within the same network or forest, depending on the trust model implemented.
It's best you talk to your network administrator to figure out what's possible on your network.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Can i retrieve the login details from a sharepoint portal server?
|
|
|
|
|
Same way I mentioned before. Read about the Page.User property. If you need help specific to SharePoint, I suggest you try a search for "SharePoint" on google[^]. There's many sites full of helpful information. Your problem is not specific to C#.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Thankyou, with ur help i am able to get the details of the user who has logged-in into the portal server. I have another problem. I have a webpart and depending on the user who has logged in, i need to display a webpage. I am unable to do it, any suggestion?
|
|
|
|