|
Hi, Dear Respected Programmers
Kindly let me know, How may I use REGEX? because i do not know about System.??? which will use after pressing dot => System.???
Thank you in Advance
|
|
|
|
|
hi,
this link will help you.
Regex Tutorial
hope this helps you.
Nitin...
|
|
|
|
|
System.Text.RegularExpressions
jamil abou khalil
|
|
|
|
|
System.Text.RegularExpressions
|
|
|
|
|
how to display emp table in to data grid view
valluri kiran babu
|
|
|
|
|
What is an "emp table"? What do you want to do exactly, and what trouble are you facing?
Regards
|
|
|
|
|
|
Hi
I am exporting one datagrid in .xsl file.
So, On particular button click event i have done all coding to save datagrid in .xsl file.
This is fine.
When i select the path to open-save file dialogue box, my excel sheet will get saved, but i want simultaneously to save one another folder to same path , which i am selecting by this open-save file dialogue box.
How can i retrieve the "file-path" which i am selecting from that open-save file dialogue box ?
I want that "file-path" in one variable which datatype is string.
Plz. help me out....
prakash sawant
|
|
|
|
|
This would likely be the trick :
<br />
<br />
string sSelectedFile = null;<br />
if (fileDialog.Show(this) == DialogResult.OK)<br />
sSelectedFile = fileDialog.Filename;<br />
<br />
|
|
|
|
|
Hi All,
I want to get FileInfo objects for only files after a specified time. Means i only want to get file names which are created or modified after a specified time. Is there any way or method in .Net for this ?
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Not directly. You can get all of the files in a directory and then loop through the resulting array checking the last modified/created times. If those times are after the specified time add them to another collection to get the final result.
The other option would be to use interop with some of the Win32 API calls, but I don't know off-hand which functions you would need to use.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Hi,
I have hosted my ASP.NET 1.1 application on shared hosting server. My application is running fine on localhost but i am not able to get the permission for my two dll files which i have used.
When i try to access that page, it shows the error like....
<i>Required permissions cannot be acquired.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Security.Policy.PolicyException: Required permissions cannot be acquired.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[PolicyException: Required permissions cannot be acquired.]
System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +2737893
System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +57
[FileLoadException: Could not load file or assembly 'WebChart, Version=1.1.1.4, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +211
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +141
System.Reflection.Assembly.Load(String assemblyString) +25
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +32
[ConfigurationErrorsException: Could not load file or assembly 'WebChart, Version=1.1.1.4, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +596
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +3487289
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +46
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +177
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +180
System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +3454869
System.Web.Compilation.BuildManager.CompileGlobalAsax() +51
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +462
[HttpException (0x80004005): Could not load file or assembly 'WebChart, Version=1.1.1.4, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +57
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +612
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +456
[HttpException (0x80004005): Could not load file or assembly 'WebChart, Version=1.1.1.4, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3434991
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +252
</i>
I get little bit idea about this, like its due to Medium Trust on shared Host server, but how to resolve that error, please help me out!!!
Regards,
Jay Khanpara
|
|
|
|
|
Hi All,
I am developing some application where in I copy a file if it is not in use. I want to check first whether it is being used or written to by any other process. If it is not being used i will copy it to some folder. Note that this file can be on a Network share. I want some functionality like Handle[^]
This is urgent and any help will be appreciated.
Note that I dont want to implement methods where I will open the file in Write mode and then catch exception to know that the file is in use. This is not the proper method.
There should be some method which windows uses to find whether an exclusive lock exists on a file.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Hello,
System.IO.FileInfo youreFile = new System.IO.FileInfo("filename");<br />
if((youreFile.Attributes & System.IO.FileAttributes.ReadOnly) != System.IO.FileAttributes.ReadOnly)<br />
{<br />
}
Have not tested it.
All the best,
Martin
|
|
|
|
|
I am working with two functions that format a byte array in preparation to send down the serial port (which .Net 2.0 is a but rough) and strip the formatting from the bytes recieved. These work fairly well, but in this case I had to make a few variables class wide because of the way .Net serial port works. These two functions have similar form, and as such, they use some common variable names. The one in particular was "checksum". Long story short, I move one of the function's "checksum" to a class-wide global variable and left the other in the function. I.E:
<code>
namespace Coda_Verifier_Pro
{
public partial class MainForm : Form
{
byte checksum;
private void myFunction1()
{
checksum = 0x00; //do stuff with checksum
}
private void myFunction2()
{
byte checksum;
checksum = 0x00; //do stuff with checksum
}
}
}
</code>
Shouldn't the complier catch this? Am I missing something obvious? This is why I hate using Global variables.
*****************
"We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW
|
|
|
|
|
What is it that you were expecting the compiler to catch? In myFunction1 you are accessing the global checksum variable. In myFunction2, you are modifying a local variable (local to the function). The fact that they have the same name is irrelevant to the compiler as it is able to figure out the correct scope for each variable access.
If you want to be clearer about it, you could use this.checksum in myFunction1 which explicitly states you are using the global variable.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
I thought in VS2003, it would compile error (or at least warn) of variables in the same namespace that have the same name. While I see how the compiler figures it out, it does not seem like good practice??? What if I DID want to access the global checksum in myFunction2? Would this. still work?
*****************
"We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW
|
|
|
|
|
As far as I know, the compiler has never generated such a warning for variables.
As far as being good practice, I'm not sure if there are really any rules defined for this sort of issue. There are legitimate times when you want a global (class-wide) variable with a specific name and need to use a local variable (either an explicitly defined local variable or a function parameter) with the same name. It can make things difficult to keep track of which one is being manipulated, but that is generally the only issue I am aware of.
In order to access the global checksum in myFunction2 you have a few choices:
1. Remove the local variable.
2. Rename the local variable.
3. Access the global variable as this.checksume
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
I believe that the most common practices are:
:: Always access class member variables using the this keyword.
:: Name class member variables with a leading underscore character.
I have tried both, and they work well. It's a matter of taste which one you want to use.
---
b { font-weight: normal; }
|
|
|
|
|
|
insert "-" in between words in a sentence using C#
|
|
|
|
|
Homework?
Nevertheless, try this: mySentence.Replace(' ','-');
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
I was wondering if you could help me. I am working in Visual C# 2005 and I am stuck on a problem.
I want to use the PropertyBinding of a textBox to bind to a Property where I set up a StringCollection. The catch is I want to bind my control to one of the elements or indexes of StringCollection only.
Maybe I am taking the wrong approach to my problem. What I am trying to accomplish is that my application will have a set of Property Settings that are binded to all of the forms controls. But I want to iterate through the Properties values in a for loop and add them to a binary file later. I would like to do this in a for() loop, but I do not see a sequential way of doing this. So my idea was to create one Property setting that is a string collection so that I can iterate through the binded values and add the values to my binary file.
Can you suggest a good solution? Any help is greatly appreciated.
Regards,
John Flach
|
|
|
|
|
In my application I show some dialog box.
Particularly there is an auto-save dialog box (i.e. a SaveFileDialog) , which is shown with a timer.
Of course it's modal (shown with ShowDialog())
I should also say that my Application is using multiple Form, i.e. I start with Application.Run() (without the form argument) and I could have many document windows.
Now the problem is, if the auto-save of my program start when the user is using an other aplpication (say Paint.NET for example), when the user click back on my app, sometimes the modal SaveFileDialog is behing the app's other form. Clicking on the form just beep, and the user have to use ALT+TAB to show the SaveFileDialog, but some people might think my app is just buggy.
What can I do to avoid this behavior?
|
|
|
|
|
Make sure the SaveFileDialog specifies your main form as it's Parent/Owner.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|