|
That's just too big a question to expect a reasonable answer in a forum reply. I'd be looking for articles on related topics. I know there's a color coded editor class on CP, although it may be in C++.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
where can I consult articles for this topics?
Had better be a C# aspect of
|
|
|
|
|
The language doesn't really matter, what you need are concepts of how to build such a system at a higher up level. If you're looking for source code to copy and paste, you may as well give up now. Like I said, there's at least a syntax coloring editor in MFC on this site.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I found a JAVA editor here[^] from codeplex. It comes with syntax highlighting. You can take the necessary parts from that program.
|
|
|
|
|
Hi All,
I have an web service, which is going to create files and access files in/from a shared folder.
Now when the folder is specified as the UNC path, the web service is unable to access it.
For me only the privileged user can access the folder and I have assigned the security through code to a user who is in AD. Now I don't know how to access it in the web service and how to pass the credentials to it.
Can any one help in this regard?
<br />
(For Security reason the user "Everyone" is also removed from the security and only the AD user can access the folder and the current identity of the system can be any other AD user)
Thanks a lot in advance.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Hi everyone,
I tried the setting as below:
<asp:gridview id="gv1" runat="server" autogeneratecolumns="False" emptydatatext="No Items items found." font-size="9pt" width="100%">
Well, the fonts in the Item template were displaying correctly.
However, text in the controls inside EditItemTemplate were still size 12.
I have tried the below too:
EditRowStyle font-size="X-Small"
no use either.....
Can someone advise me wat i am doing wrong? Thanks a million!
Regards
blooper
|
|
|
|
|
Hi all,
I got problem moving the object in richtextbox.
How i can move object such as rectangle in richtextbox using mouse event..?
Thank You..
KAM83_CODEPROJECT
modified on Wednesday, April 9, 2008 1:34 AM
|
|
|
|
|
Im currently working on a C# project that requires the use of proxies.
Example:
String WholeProxy = "127.0.0.1:80";<br />
String Address = Here I need to split "WholeProxy" to get just the "127.0.0.1";<br />
int Port = Here I need to split "WholeProxy" to get just the "80";
Does anyone know how to do this?
Thanks,
Joshua123321.
|
|
|
|
|
string has a Split method for that
and int has a Parse method
|
|
|
|
|
You would need a regex to pull a number out of a string. It's also always better to use int.TryParse instead of int.Parse, just in case.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi:
Hello everybody:
I need to parse the form field, say Description. I want to disallow all the html tags but anchor text. Basically i need a pattern that will match 0-9 a-zA-Zm -, _, @ and anchor text (can be multiple occurance). So if the text in description form field match this criteria, i will allow the user to submit the form successfully otherwise validatiion will fail.
examples:
Valid input
-----------
My name is john doe. i live in xyx, city xyn state.
I am a technial recruiter. my web site is john doe
Please visite. my phone number is 000-000-7777. My email is x@y.com
My Work website is work website
Invalid Input
-------------
My name is john doe. i live in xyx, city xyn state.
<img src=cby.com> or <script><script
I am a technial recruiter. my web site is john doe
Please visite. my phone number is 000-000-7777. My email is x@y.com
Need help with regular expression
|
|
|
|
|
Is there somewhere that you could point me to learn how to write a program to automatically map printers that are shared on a network? I've looked it up and found them in VB but not C#. I do not know VB.
Is this possible?
|
|
|
|
|
Let's say a server is listening on port 24000. Lo and behold, a client connects on port 24000. Immediately after establishing the connection, the client sends a message to the server. The server shows the message as coming from 123.456.789:54326 (as an example).
The port the client is ultimately communicating on is 54326. How do I control the range of ports the server will use for this auto-negotiated port? I've looked at most of the System.Net namespace and couldn't find anything obvious.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi John
You means, you restrict range of the port access by the client, is it correct?
if I'm correct you must set port to client ,which server port want to connect by the client.that's mean you haven;t any way to set range of the part.so must specify your own method, then access that list of port from your client.
|
|
|
|
|
I'm trying to use a SqlDataAdapter to update a dataset containing multiple tables linked by a common parent table. I've set up my relations and ALMOST everything is working except for when my RowUpdated event handler tries to retrieve the identity field. Here's my code (without the try/catch/finally stuff and sanitized field names)
<br />
private void ParentRowUpdated(object sender, SqlRowUpdatedEventArgs e)<br />
{<br />
SqlCommand dbCommand = new SqlCommand("SELECT @@Identity");<br />
SqlConnection cn = new SqlConnection(GetConnString(m_strConnStringName));<br />
<br />
using (SqlConnection dbConn = new SqlConnection(GetConnString(m_strConnStringName)))<br />
{<br />
using (SqlDataAdapter daAdapter = new SqlDataAdapter())<br />
{<br />
dbCommand.Connection = e.Command.Connection;<br />
daAdapter.SelectCommand = dbCommand;<br />
e.Row["p_key"] = Int32.Parse(daAdapter.SelectCommand.ExecuteScalar().ToString());<br />
e.Row.AcceptChanges();<br />
}<br />
}<br />
}
Using @@Identity in my select query does retrieve the correct Identity value. However, when I try using SCOPE_IDENTITY() I get a blank value returned. I don't like using @@Identity because this will be a multi user system so I'm worried about getting the wrong value. Does anyone have any idea of a better way to do this?
Thanks!
|
|
|
|
|
I am new to C# and struggling with what should be a simple solution.
Problem:
I am running a batch file that calls a script executing a MOSS STSADM operation, however; the operation does not allow me to pass certain parameters thus it will prompt for certain arguments.
What I am trying to do:
Execute the batch file within C# and pass the parameters so that it does require any user action.
I have tried various approaches and I am just spinning in circles any suggestions as to the “frame work” would be greatly appreciated.
Thanks
|
|
|
|
|
Use Process.Start[^] to execute a batch file with optional arguments.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Thanks for that, I am using process.start and it seems to pass the arguments to the batch which executes.
However, I tried to answer the prompts that followed by accessing stdin but the only argument that seems to get passed is the "Enter Key".
Any thoughts as to where I am going wrong?
Thanks,
Dennis
Regards,
Hulicat
|
|
|
|
|
hi
just use the process class and pass the args
|
|
|
|
|
Hi, im making a dynamic site in ASP.NET and coding in C#. And I have a problem. The system is kind of like a windows desktop where you can drag around windows etc etc, but now i want to run a function to add something to the database. And this is fine, using a asp button and using its onclick function. BUT that causes a postback which refreshes the windows back to their original places and resets everything back to how it started. So im thinking the best plan would be to just use an HTML button and run the C# function from JS. But I have no clue how to do that. Or even if thats what I should be doing.
Thanks so much,
Matt
|
|
|
|
|
In order to do this without a postback you really want to consider using AJAX.
|
|
|
|
|
You could probably implement the ICallbackEventHandler interface. The MSDN sample is clear enough. I tried it successfully last week. I used to write a simple page that generated random numbers on the server. I had a loop in javascript that would retrieve the latest number and update a label on the page on the client side.
Here's a link to the MSDN article I used as a guide:
Implementing Client Callbacks Programmatically Without Postbacks in ASP.NET Web Pages[^]
|
|
|
|
|
The code I have below only takes data from one dynamically created tabpage (the default)‘s datagrid and exports it to a spreadsheet. I would like the application to take the data from all the dynamically created tabpages’ datagrids and export the data to excel and create a new worksheet for each tabpage as it is exporting. Please help.
Microsoft.Office.Interop.Excel._Application _appClass = new ApplicationClass();
_appClass.Visible = true;
_appClass.Caption = "Exported ECS Errors";
Microsoft.Office.Interop.Excel.Workbook wbk = _appClass.Workbooks.Add(XlWBATemplate.xlWBATWorksheet);
Worksheet obj = (Worksheet)wbk.ActiveSheet;
// get the collection of sheets in the workbook
Microsoft.Office.Interop.Excel.Sheets sheets = wbk.Worksheets;
Range r = (Range)obj.Cells;
try
{
//Load the Headers and make them BOLD
for (int i = 0; i < ((DataGridView)this.dgOutput).Columns.Count; i++)
{
r[1, i + 1] = ((DataGridView)this.dgOutput).Columns[i].HeaderText.ToString();
((Range)r.Cells[1, i + 1]).Font.Bold = true;
}
//Load the data from the datagrid to the new spreadsheet
for (int i = 1; i < ((DataGridView)this.dgOutput).Rows.Count - 1; i++)
{
for (int j = 0; j < ((DataGridView)this.dgOutput).Columns.Count; j++)
{
r[i + 1, j + 1] = ((DataGridView)this.dgOutput).Rows[i].Cells[j].Value.ToString();
//Do the colors
if (((DataGridView)this.dgOutput).Rows[i].Cells[j].Value.ToString() == "Update OK")
{
((Range)r.Cells[i + 1, 1]).Font.Color = Color.Green.G;
}
}
}
}
catch (Exception EX) //user closes the Excel file while it is loading data from the datagrid
{
MessageBox.Show(EX.Message + "The Excel file was closed while loading data from the datagrid.",
"Error : Loading file!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Mvelo Walaza
Developer
Telkom SA
|
|
|
|
|
hy everyone!
i do have a problem, sounds easy but i didn't find a solution so far.
i have a textfile which contains fieldnames like |pagenumber|
i want to replace this fieldname with the number of the page. this could be of length 1, 2, 3 ...
everything works fine until the switch from length 1 to length 2, length 2 to length 3 etc.
I want it to look like
my town
1
......
my town
9
my town
10
.....
my town
100
buy it looks like
my town
1
.....
my town
9
my town
10
even if i move it to the left then the first few numbers are too far to the left.
does anyone of you know a way how to replace a text and format it correctly.
thanks.
stephan.
modified on Tuesday, April 8, 2008 3:48 PM
|
|
|
|
|
did you read your post?
without PRE tags it does not show any difference between what is obtained and what is wanted.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|