|
tauras81 wrote: I had created the certificate by right clicking the Default web site icon in the iis but i donot no how to use it for my website.
Just access your website with HTTPS.
tauras81 wrote: I had used the server.transfer to hide the query string on the first page load it does not show query string but when button is clicked it again shows the query string.
If you feel query string is insecure, why not using other state management techniques?
|
|
|
|
|
Again, you can use Google to find out how to do the HTTPS side of it, and search for articles here on CP that have to do with URL Rewriting.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
As others have said, if you are scared of putting stuff on the URL, then don't put it there. Use the session instead. Typically you shouldn't have to put much in the session, but anything that is a security issue, goes there.
Just to add, you're lucky to get so much help, given that you asked in the wrong forum.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Guys,
How to match single specified character with regular expression?
E.g. I should be able to get string with single slash only "\something" not something "\\something".
Thanks.
|
|
|
|
|
Search for the slash followed by any character that's not a slash. There's a great program called Expresso you can get from CP and elsewhere, it really helps with building regex.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello
I have 2 tables: Comperitor(idcompetitor, Name, Adress) and Competition(idcompetition, About, Town). Between them is a also table named Participate(PFK idcompetitor, PFK idcompetition, Date)[because relationship is N:M]
I have those tables on my sql server 2005 and on dataset inside vs.05. I put a Datagrid on my form and tryed to fill data from table Participate to my datagrid. I achieved but values were afcourse only ID-s of competitor and competition...So i tried to create new tableadapter with his own sql statemetn : SELECT c.Name, cs.About, p.Date FROM Competition c, Competitor cs, Participate p WHERE c.Idcompetitor=p.Idcompetitor AND cs.idcompetiton=p.idcompetition. When called tableadapter.Fill method on this datatable wverything is fine but what to do when you want to update values on table participate with this datagrid is that possible or there is another way of doing?
|
|
|
|
|
Ain't me babe wrote: there is another way of doing
There are many ways of doing this, you have asked for an opinion on one of the basic precepts of developing applications, how to manage my data. It is unlikely you can get a satisfactory answer via a forum. This takes some years to get a good handle on.
It looks like you are doing all your data manipulation in the UI whereas most people will do it in the database or the object layer. EG I would have created a view in SQL to service the grid, but then I would not have used a grid in the first place, I would use a treeviw and implement drag and drop from listviews of players and comps.
You are also relying on the UI data controls to do your work - this will hurt you will quickly find their limitations (about now). Look into Data Access Layer (DAL), it is a complete change from what you are doing but will serve you in the future.
Good luck
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi All,
Im experimenting with multithreading , now I have a question relating to a sample project that I did.
heres my code...
using System.Threading;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Thread threadone = new Thread(new ThreadStart(ProcessOne));
threadone.Start();
Thread threadtwo = new Thread(new ThreadStart(ProcessTwo));
threadtwo.Start();
}
public void ProcessOne()
{
for (int i = 0; i < 10; i++)
{
while (i)
{
}
DropDownList1.Items.Add(i.ToString());
}
return;
}
public void ProcessTwo()
{
for (int i = 10; i < 20; i++)
{
DropDownList2.Items.Add(i.ToString());
}
return;
}
}
Ive got two dropdown lists that I populate with numbers, yet the result is different each time I run the program.
Sometimes one list is populated and the other is isnt and vice versa.
I guess the main question Im asking is how I make it consistently populate both of the lists each team.
Could somebody explain how this would be inappropriate and when is the best times to use multithreading?
Kind Regards
|
|
|
|
|
The best time to use threads is when you have some long task that needs to be done while the user can still play around with the GUI.
I also use it alot with web browser type stuff, web scraping for example. I had an app where I needed to scrap like 5000 web pages for simple data off each, so I multithreaded it to run like 75 at a time, drastically reducing the wait time needed to run.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Thanks for the advice, so its best to use it when doing big tasks.
As for my code I posted, could you somehow explain why the lists sometimes get populated and sometimes it doesnt?
Kind Regards
|
|
|
|
|
It could be that the thread doesn't get its work done before the form draws itself. That would be my guess.
When working with threads, you need to make sure that each thread only messes with stuff that is on its own thread. Google thread safety and you should find what I am talking about. Fix that and it may work, if not, force the form to redraw itself after you add things to the list.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
|
I will be sure to have a look at the reference. Thanks again!
|
|
|
|
|
No problem, I haven't used multithreading too extensively either, but some of the stuff you'll be doing as you learn it I should be able to help with, just post here on CP and your sure to get help.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Hi,
two or more threads will execute their code at their own pace; the exact sequence of things overall cannot be predicted unless you enforce some ordering by synchronizing the threads.
Their independence is their biggest advantage, one thread could be searching a disk while another is crawling the web, all have their own unpredictable delays.
If you must protect a shared data structure against inconsistencies, or if your overall logic requires sequential access for some reason, you need synchronization (with locks, mutexes, whatever).
|
|
|
|
|
So I guess that it is kind of pointless to have multithreads if they all do the same thing, whereas they are more useful if they do different tasks.
Thanks
|
|
|
|
|
Hi,
it may make sense to have a few identical threads that each execute a sequence of various operations, say some calculations, some disk I/O, some networking; even when they start in sync, they will evolve differently and may well end up with one performing calculations, one waiting for the disk, and one waiting for the network; each in turn shifting their roles.
But indeed the more natural situation is where different kinds of things are organized in separate threads: one calculating, one performing disk I/O, one taking care of the network, etc.
BTW: that is what OO principles automatically make you do anyhow; the disk is an object, and you give it some threads if that seems appropriate; the network idem; etc.
|
|
|
|
|
Adding to what others said,
When you use such kind of threads in web applications, thread will be started and if it is doing some long job, ASP.NET will finish rendering the page and send back to client without waiting the thread to finish. So you need to use Thread.Join or wait handles to wait on the worker thread until it finishes. But this makes the usage of threads kinda pointless.
|
|
|
|
|
The add new method of the Currency Manager fails with my checkbox that is bounded to a data table.
This is how I bound my checkbox to my table.
cbxAvailable.Databindings.Add(“Checked”,invManTable,”IsAvailable”);
This is the Add code that runs when I click the Add button:
myPosition = invManManager.Position;
invManManager.AddNew();
When I run the program I cannot add a new row to my table. How can I fix this?
|
|
|
|
|
I have an MDI form with a menu strip. When I open a child and maximize the child within the mdi parent an icon appears on the left of my menu items. When clicking on this item I get the options to restore, minimize, close, etc...
I have 2 questions regarding this. First, how can I change this icon? I've set the icon for the MDI parent, but the icon appearing here seems to be some type of default visual studio icon. Second, I've used a custom color table to set the menu colors in my form. This menu is not picking up my color table. How can I change these things?
|
|
|
|
|
bcryner wrote: I've set the icon for the MDI parent,
You're putting child-forms into the MDI-parent, right? Don't they have their own .Icon property that defaults to the VS-default if you don't set it?
I are troll
|
|
|
|
|
Good suggestion. However, I just tried it and still no luck
|
|
|
|
|
Hello,
I am try to edit an xml file via DataSet in my C# app, by adding a new table to the structure with multiple nodes to the structure - but the table should be a child table of one of the existing Tables in the structure I have read in.
In other words:
<parenttable>
<data1>FOO
Should end up like this:
<parenttable>
<data1>FOO
<mychildtable>
<test>BAR
I'm having problems getting the table in the correct place when I write the XML after I change it. I am adding the table/fields/records, and setting up the relations, but for some reason when I process the xml the new table I have added just appends to the end of the xml file and doesnt appear in the branch where it should.
Here is the code snippet of what I'm doing:
XmlTextReader xmlreader1 = new XmlTextReader("Test.xml");
DataSet ds = new DataSet();
ds.ReadXml(xmlreader1);
DataTable newTable = new DataTable();
newTable.TableName = "MyChildTable";
newTable.Columns.Add( "NewField" );
newTable.Columns.Add( "ParentTable_ID",System.Type.GetType("System.Int32") );
ds.Tables.Add( newTable );
ds.Tables["MyChildTable"].ParentRelations.Add( "MyChildTable", ds.Tables["ParentTable"].Columns["ParentTable_ID"], ds.Tables["MyChildTable"].Columns["ParentTable_ID"], true);
DataRow newRow;
newRow = ds.Tables["MyChildTable"].NewRow();
newRow["Test"] = "Value";
newRow["ParentTable_ID"] = "1";
ds.Tables["MyChildTable"].Rows.Add(newRow);
ds.AcceptChanges();
StreamWriter myStreamWriter = new StreamWriter("Out.xml" );
ds.WriteXml(myStreamWriter);
myStreamWriter.Close();
Can anyone see what I am doing incorrectly or have any suggestions?
Thanks,
Greg
greg@ram-software.com
|
|
|
|
|
Hello all,
how to insert a space with patten matching in c#?
I need to find a string "[a-z][0-9]xyz"
and insert a space before "xyz" how can we achieve?
E.g.
"bddd"
should be changed to
"b ddd"
Character at place "b" can be anything but "ddd" will be static.
Can i use regular expression?
Thanks
|
|
|
|
|
Member 2324483 wrote:
Can i use regular expression?
You could take the regex pattern (?<word>\w*)ddd and use the replace pattern ${word} ddd
Regex.Replace(someString, @"(?<word>\w*)ddd", "${word} ddd")
regards
modified 12-Sep-18 21:01pm.
|
|
|
|