|
Bert Mitton wrote:
I'll usually save it in the application folder.
It's easier to find, and it can't get confused with the error log from another
program.
and is usually read-only to users running the app, so it's impossible (default user permissions) for the log to be written there.
modified 11-Nov-11 8:51am.
|
|
|
|
|
Wait, why is the answer removed? It's an answer (albeit a wrong one), right? I think the answer shouldn't be removed as it can point out a practice that should be avoided. Dave, Can you please include the original answer in your message?
Oxfords English < Official CCC Players Dictionary
Excuse me for my improper grammar and typos.
It's because English is my primary language, not my first language.
My first languages are C# and Java.
VB, ASP, JS, PHP and SQL are my second language.
Indonesian came as my third language.
My fourth language? I'm still creating it, I'll let you know when it's done!
|
|
|
|
|
Nope, 'cause I can't see it either.
|
|
|
|
|
If you edit the answer you gave, it should give you the message that the user posted. This has worked for me in the past.
|
|
|
|
|
|
Windows provides special places, see here[^].
|
|
|
|
|
Generally recommended ... your app should have a folder under the common application data folder for certain users and/or all users. App data folders are usually created by their installers and have their permissions set appropriately for whatever access is required (read write etc.). You should always use the system functions to retrieve the locations of the root special folders (System.Environment.GetFolderPath(), SHGetFolderLocation(), SHGetKnownFolderIDList()) since the paths vary on Windows versions and users can move them.
Folders of interest for (local (non-roaming)) app data:
System.Environment.GetFolderPath(LocalApplicationData)
(Win32 Shell APIs FOLDERID_LocalAppData SIDL_LOCAL_APPDATA)
System.Environment.GetFolderPath(CommonApplicationData)
(Win32 Shell APIs FOLDERID_ProgramData/CSIDL_COMMON_APPDATA)
Mark Salsbery
|
|
|
|
|
Hi.
I want to know how the Google Search Algorithm calculates the information necessary to rank a website. Like, how does it measure inbound/outbound links links, how many times it has been shared on Facebook/Twitter, etc.
The only way I see it is to search every website on the internet, and then write all the outbound links, and then do bunch of math to go through all websites and rank the inbound links. But that would be toooo inefficient.
I'm not sure how it is done, I had a cool project in mind, but I am looking for a more efficient approach than the one I wrote above.
Could please guide me in the right direction?
Thanks!
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson "Why is it drug addicts and computer afficionados are both called users?" - Clifford Stoll
|
|
|
|
|
google "page rank algorithm"
There's a powerpoint presentation, one of the first hit that discuss that.
In short, it works by working graphs and weights and minimum distance and other stuff like that.
and more info on http://en.wikipedia.org/wiki/PageRank[^].
Watched code never compiles.
|
|
|
|
|
Hi,
I am wondering why I am getting this warning in my C# WinForm application in Visual Studio 2010?
Warning 1 A reference was created to embedded interop assembly 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\Accessibility.dll' because of an indirect reference to that assembly created by assembly 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Windows.Forms.dll'. Consider changing the 'Embed Interop Types' property on either assembly. Smart PBX Logger
Thanks,
jassim
|
|
|
|
|
|
but I guess it's referring to the accessibility.dll
do i really need ti in my project? is it added by default?
|
|
|
|
|
I try it but not much helpful. please send any other links
|
|
|
|
|
... edit #1 ... supplied link to critique of System.ComponentModel by SA Kruyakov as mentioned in text ...
Context: WinForms .NET 4.0 Client FrameWork, VS 2010 Pro
The goal of this question: to find a way to use a Static generic list containing instances of a non-static class to DataBind to a ListBox.Items Collection ... so the collection is dynamically updated ... without relying on using the BindingList Type in System.ComponentModel.
Background:
Back in 2007, Frans Bouma wrote[^]:List<T>doesn't raise an event that something was changed inside it,
as it doesn't implement IBindingList. This thus means that the bound
control can't 'observe' the datasource, so it can't know if something
changed inside List<t>. Since then, I've seen code examples where it looks like a generic List was rather easily set as the DataSource for ListBox, and I assumed the "barrier" that FB described in 2007 had been removed. Such as: [^].
And now:
Well today, I created a static class that holds a static generic list of a certain non-static class: like so:
public static class People
{
public static List<Person> ListOfEverybody;
public static Person CurrentPerson;
public static bool IsPersonAlreadyEntered;
static People()
{
ListOfEverybody = new List<Person>();
}
public static void AddPerson(string pName)
{
IsPersonAlreadyEntered = ListOfEverybody.Exists(prsn => prsn.PersonName == pName);
if (IsPersonAlreadyEntered) return;
CurrentPerson = new Person(pName);
}
} I set up the non-generic class 'Person with a Public Property I thought appropriate to use in data-binding, and a ToString over-ride:
public class Person
{
public string PersonName { get; set; }
public Person(string newPersonName)
{
PersonName = newPersonName;
People.ListOfEverybody.Add(this);
}
public override string ToString()
{
return this.PersonName;
}
} Results:
To sum it up, all my experiments in trying to bind a ListBox on a Form to the static ListOfEveryBody<person> in the static class People, so that the ListBox contents are updated as new entries are added ... using every combination of reasonable entries for DataSource, DisplayMember, ValueMember, fail.
My experiments with the newer 'BindingSource' component ... fail.
And then, a "bloody solution:"
Finally I trotted out the 'BindingList' from System.ComponentModel (the Library of which Sergey Kruyakov is very critical[^]), which Bouma had mentioned, and got that working to dynamically update the ListBox Items.
However, BindingList does not support the very nice System.Collections.Generic '.Exists' function, which I find so handy.
So I ended up maintaining parallel Lists, one BindingList<Person>, and one List<Person> which really takes away that mint-fresh-all-over feeling I crave
I'm thinking there must be a way to databind a generic List that happens to be static to a ListBox's Items so it is dynamically updated that's much more "freshy."
Appreciate any suggestions.
thanks, Bill
"Last year I went fishing with Salvador Dali. He was using a dotted
line. He caught every other fish." Steven Wright
modified 11-Nov-11 1:11am.
|
|
|
|
|
Maybe write your own? Wrapping the List<Person> and raising events as needed?
|
|
|
|
|
Thanks for your reply; there are several simple solutions. Like exposing the ListBox on the Form via a Public Property, and just adding to its Items Collection in the constructor of the 'Person Class.
But, I am very curious to know if there is another direct way to get the kind of binding that (until now) I assumed was pretty simple to do.
edit ... and that curiosity to understand the why ... and the broader implications ... and to, hopefully, get some 'best practice' ideas, and 'food for further thought' ... not just get a "quick fix" ... was my criterion for posting this here, rather than C# QA.
best, Bill
"Last year I went fishing with Salvador Dali. He was using a dotted
line. He caught every other fish." Steven Wright
modified 9-Nov-11 11:20am.
|
|
|
|
|
Hi to everyone,
i've a problem while overriding the render method of a control.
Here my scenario:
I need a panel that can render some control based on a property. I created a control which inherit from Panel, i added a Text property to the panel and i made the override of the render method.
The override basically read the text property and add controls to the panel based on some markers that are in the text.
In this case the Text property is something like:
"bla bla bla bla bla bla bla ##calendar## bla bla bla bla bla bla bla"
Everything seems to work (i mean that the controls gets rendered), but the problem is that i loose the functionality of the controls i add.
In my example i'm trying to add a Calendar, it gets rendered but the user is not able to click on the days ( the problem is that the a href="javascript:__DoPostBack......." is missing).
Can you help me understand what i'm missing?
Here the overridden method (just a test Render):
protected override void Render(HtmlTextWriter writer)
{
string[] t = Text.Split(new string[] { "##calendar##" }, StringSplitOptions.None);
writer.Write(t[0]);
Calendar c = new Calendar();
c.Attributes.Add("style", "float:left;");
c.RenderControl(writer);
writer.Write(t[1]);
}
If something is not clear (due to my english) just let me know and i'll try to explain it better.
Thank you very much in advance.
Alessandro
|
|
|
|
|
I'm not sure on how to attach the photograph of the grid as an example that I've created.
anyway, i've got this 17x17 cell grid. The 1st row and 1st column are the cell header to indicate column number 0-F, and rows to show 0-F. The rest of the cells would be the textbox array, which consists of 8 character length (8 bytes long). I have set them horiztonally and vertically centered. no problem there.
However is that there is 1 problem... I cannot set the foreground with multi-colored style. I've learned that RichTextBox can do the job. Ok no problem... changed them to RichTextBox. Now that I've faced one additional problem with RTB control... NO Vertical alignment! ARGH!
Later, I just learned that WPF's RTB control can handle everything I need. Just that, I'm trying to understand on how to put in the text in that control. There's no RichTextBox.Text property there. Can anyone give me tips on what I can use for the 17x17 grid?
Need:
* Horiztonal & Vertical centered
* able to adjust font size
* able to control partial text's foreground color
|
|
|
|
|
Hi,
I'm trying to setup a new Ras entry via RasSetEntryProperties, which is working fine, but I can't find a way to ensure that all available modems are checkmarked in the DUN's properties dialog.
The RASENTRY struct has a member called szDeviceName and this will checkmark the modem whose name is supplied but I don't know how to address more than one modem with this.
I've tested checkmarking all other modems in the connection's properties dialog and then ran RasGetEntryProperties to see if anything was changed in the RASENTRY struct but there is no difference.
I've also looked into RASDIALPARAMS and RASSUBENTRY but I don't think they apply in this case.
Any suggestions on how to accomplish this are appreciated.
Thanks
|
|
|
|
|
Hey! don't use "pre" tag for normal texts. Always use "pre" tag for Codes.
|
|
|
|
|
Thanks for the heads up, sorry about that.
|
|
|
|
|
you are most welcome
|
|
|
|
|
hi,
i would like to know i can pick the hardware unique serial no for my applicaiton. i want to generate a code for unique pc so only one user can use my software.
Thanks
regards
Umesh Daiya
Web Developer
|
|
|
|
|
AFAIK, there isn't a unique hardware number as such. Microsoft use a psuedo one which is built from things like hard disc serial numbers and such things and that's why if you upgrade your computer with new discs etc. you are sometimes asked to reactivate Windows. It looks like a new machine.
You'll need to be prepared to take similiar steps if your customers do such things. Probably getting the serial number of the hard disc is close enough, think there's plenty on how to do that such as:
http://www.eggheadcafe.com/articles/20021019.asp[^]
Regards,
Rob Philpott.
|
|
|
|
|
Then probably no one will use your software.
Make your software free, perhaps as a beta, and see how many people actually want to use it before trying to do anything like that.
|
|
|
|