Hi, I am using Javascript to open up the default mail client and start an email eg string mailto = "mailto:?Subject=Link to your order&Body=Here is the link to your order" + Request.Url.ToString() + "?Id=323498; ScriptManager.RegisterStartupScript(UpdatePanel1, typeof(string), "mailto", "window.open('" + (mailto) + "');", true); This works well and I get an email sent through with the hyperlink visible (and clickable - yay!) What I want to do however is to provide Display Text for the hyperlink so that whilst the underlying URL is eg http://www.google.com?id=323498 the text visible to the recipient is Your Link or something appropriate. So it is the same concept as in Outlook when you Insert Hyperlink, you provide the Address but you can also provide Text to Display. (Same in GMail etc). Any ideas how to achieve this? Thanks!!
SarahMcM
Posts
-
mailto - How to insert a URL hyperlink in the Body with DisplayText -
MSAccess 2003 flexGrid Error loading ActiveXI found the issue - the FlexGrid version on my PC(s) was incorrect. I installed VB6 and patched to SP6 then downloaded the Microsoft Visual Basic 6.0 Service Pack 6 Cumulative Update (see http://support.microsoft.com/kb/957924[^]) Only then did I get the latest version (from March 2009) of FlexGrid.
-
MSAccess 2003 flexGrid Error loading ActiveXThanks for your reply ... I don't think that is the issue because the original form (that I copied for the new form) doesn't have a problem. MS Access is just evil ...
-
MSAccess 2003 flexGrid Error loading ActiveXI have a legacy MS Access "application" that uses MS Flex Grid. I've had to create some new forms - copies of existing forms (basically identical except against different tables - same structure different names) but the new forms throw errors on anything to do with the flexgrid. The errors are generally of the form "The expression <>you entered as the event property setting produced the following error: There was an error loading an ActiveX control on one of your forms or reports". It only happens on the new copies of forms that contain flex grid. Forms that already existed with flex grid on them still work. I've unregistered and re-registered flex grid. I've checked through the registry to see if anything is amiss - nothing obvious there. When I look in the Toolbox in Access there are two Microsoft FlexGrid Control V6.0 SP6 shown ... I can't work out why - there aren't two shown in references. I've tried it on 2 different PCs. I'm using MS Access 2003. Can anybody help here please? Thanks in advance.
-
Securing a web methodWell, not really because I don't know how you want to secure it. In my webmethods I have eg
if (isUserAuthorised(this.User.Identity.Name))
{
//do stuff in the web method} else
{
//return that they're unauthorised
}The isUserAuthorised method takes a string that is the user name and you can then do whatever you want to determine if they are infact allowed access. It depends on how you secure things. If you use AD groups then check whether the user is in the appropriate group (google for DirectoryEntry - there should be loads of examples out there and you'd be looking for something with objGroup.Invoke("IsMember" ...) I can't remember the exact syntax). If you have some database that says whether they're allowed in then call a stored procedure.
-
Securing a web methodPut the security within the webmethod call itself. I have a service that does that .. some methods are "public" others are only accessible by users in particular security groups. So the secure web methods have an if around all the code that checks if the user is allowed to use it. The Webservice implements Integrated Windows Authentication so the user's identity is available and I have a procedure that decides whether a user is authorised or not.
-
C# 2.0 Windows Service - Memory Leak? [modified]I implemented the suggestions given and the memory still grew. In the end the only way to stop the memory growth was to take out the logging altogether! So I had a service sit there and when the timer fired go Timer.Stop then Timer.Start - doing nothing else at all. Out of curiosity I changed the LogFile so it was no longer static and provided Open, Write & Close methods. In the constructor I grab the log file name from the config. On service start I call "Open" and on service Stop - "Close" and write to the log file at various points using Write. I don't like this idea for a multitude of reasons - but I did it just for testing purposes. I also removed any extraneous strings & DateTimes so my logFile.Write just writes the message to the file - no pretty DateTime stamp or anything. I've also tried a couple of variations of the actual write ... one that uses File.AppendAllText, one that uses a FileStream & StreamWriter and one that uses TextWriter with StreamWriter. Making sure I close and dispose appropriately. The File.AppendAllText was what I used in my static LogFile ... it seems to be the worst offender for memory usage. I've now got TextWriter along with the Open on start and Close on Stop. That seems like a pants way of achieving what I want to do. Now the memory consumption has slowed - but it still increases. Am I delusional in thinking that I can get this service to hover around a consistent memory usage? I left my original code (including calls to the database etc) running overnight and it got to 52Mb before I killed it. So in the hours between say 4pm yesterday afternoon and 7:00 this morning it grew from 8Mb to 50Mb. Not happy Jan :( My code needs a nappy and I have no idea where to go now :confused: I'm not comfortable installing this on a server for it to run 24 hours a day until it kills the server ... not sure I'd be too popular if I did that :)
-
C# 2.0 Windows Service - Memory Leak? [modified]Thanks. I'll make the changes and let it run for a few hours.
-
C# 2.0 Windows Service - Memory Leak? [modified]I thought about using Threads but decided it was complexity that my future replacement just didn't need. When it comes down to it ... should the service return to a low level of memory usage after each iteration? I would say it should and casting my mind back to other services I've written they generally did - but I've been asleep since then and can't say with certainty. I get what you're saying about the AppSettingsReader ... definitely bad form to call it everytime anyway - even if it isn't the source of the leak. I spent an hour going through our company "data layer" yesterday - apparently the author was of the "the garbage collector will sort it out" type so nothing is ever disposed or closed or set to null. How our database server is still up I'll never know. So once I make sure my service code is all enclosed in a nice code nappy I'll have the joy of fixing that up - yay. Thanks for taking a look for me :)
-
C# 2.0 Windows Service - Memory Leak? [modified]Thanks for your reply :) I see what you mean about the AppSetttingsReader ... I had originally called it once in the constructor but changed it after some advice from a friend. We both figured that because it was a null reference it should be cleaned up ... nevertheless it is better form to only get it once - I agree. And .. I get what you mean about the OnStop ... Thanks :)
-
Brisbane driversI'm a Brisbane girl and except for a few years in London have only ever lived here. The driving is definitely getting worse! I don't know what it is at the moment but there seems to be some competition on how many people can go through red lights. It is astonishing the number of people that go through - I'm not talking about the "it goes Orange as I enter the intersection and red before I'm out" kind of thing which is not good but happens every now and then. I'm talking about dark red! I obviously didn't get the memo. I didn't get the one about not using indicators either though ... I wonder if all cities go through this as they get bigger? The people driving in Brisbane seem to have an issue with entitlement. Everyone thinks they're entitled to the whole road and everyone else will accommodate them. And everyone is sooo angry! What is with that?
-
C# 2.0 Windows Service - Memory Leak? [modified]I have a windows service in C# .net 2.0. At the moment all it is doing is being instantiated, setting up a timer and then every interval (eg 1 minute) writing to a log file. The memory usage on TaskManager goes up and up ... I can't see any objects that I've left lying around - I've taken out pretty much everything it is meant to do ... perhaps I'm being paranoid and the garbage collector will come and clean up when it is ready? How long should I leave it? It's been a while since the last Windows Service I wrote ... any ideas? Thanks in advance :) Here are some excerpts from the code... The LogFile is a static class with a single static method "Write"
public static class LogFile { public static void Write(string message) { string logFileName = (String)(new AppSettingsReader()).GetValue("log-file-path", typeof(String)) + "FileLoaderServiceLog.txt"; File.AppendAllText(logFileName, DateTime.Now.ToString("dd-MMM-yyyy HH:mm:ss") + " FileLoaderService:" + " " + message + Environment.NewLine); }
The Service class itself
public partial class FileLoaderService : ServiceBase { private Timer serviceTimer; public FileLoaderService() { InitializeComponent(); serviceTimer = new Timer(); double intervalInMinutes = (double)(new AppSettingsReader()).GetValue("timer-interval-in-minutes", typeof(double)); serviceTimer.Interval = intervalInMinutes \* 60 \* 1000; //intervalInMinutes \* 60 seconds \* 1000ms serviceTimer.Elapsed += new ElapsedEventHandler(serviceTimer\_Elapsed); } protected override void OnStart(string\[\] args) { LogFile.Write("Service Started - starting timer"); serviceTimer.Start(); } protected void serviceTimer\_Elapsed(object sender, ElapsedEventArgs e) { //stop timer whilst we process serviceTimer.Stop(); //do processing //have removed this to try to find the "leak" LogFile.Write("Checking Queue..."); //processing done - start it up again serviceTimer.Start(); } protected override void OnStop() { serviceTimer.Stop(); serviceTimer = null; LogFile.Write("Service Stopped"); } }
And Program Main ...
static class Program {
-
I want to emigrate to AustraliaAs an Aussie that lived in London for 3 years I would accept the opinions and advice of the people here and then make your own decision :) Everyone has different things they want. I live in Brisbane (have all my life except for the 3 years in London) and I like it. The things I miss about London ... the proximity to Europe, the pounds sterling :) and a decently large market that makes lots of things very cheap (public transport, broadband, mobile phones etc). Australia IS a long way away from almost everywhere ... but there is lots to see here too (including NZ) The IT market in Brisbane is not too shabby - I've always found that those that complain about not getting jobs are the people you wouldn't want to employ. The money won't be as much as other places but the cost of living here is cheaper than Sydney, Melbourne (for example) - but still expensive overall. In general a lot of the jobs are state government so sometimes you have to role with the budget cycle but there are also lots of private companies with development roles. I've known people who lived on the Gold Coast (poms out on work visas) who loved it - surf in the morning, party at night but have never found any locals that love it year round for the tourist invasion aspect. The Sunshine Coast is my pick (personally) but the daily commute to Brissie would be torturous (there is a train but ... well ...). I prefer to live in the suburbs and go to the beaches on the weekend if that is what I want to do. You really don't have to be too paranoid about the creepy crawlies. Teach your kids young not to play with snakes and spiders and generally suburban Brisbane will be just fine. There are 2 types of spiders in my mind ... ones that run AT you and ones that sit there waiting for the thong (of the shoe kind) to come down on its head. The running ones are the ones to beware of - usually they don't bite (huntsmen) but they DO run, REALLY fast and they are REALLY big and hairy! A good pair of thongs that don't leave black marks on the paintwork (important consideration) are to be handy at all times ... and check the kickboards in the kitchen and anywhere dark and out of the rain outside (lawnmower, outdoor tables/chairs) - red backs love to set up house there. The cockies can be the size of volkswagons too - you'll get used to running screaming from them ... especially when they fly *shivers*. The thongs are effective against them too ... although a can of Mortein doesn't go astray ... snow coning is effective in slowing them down order to ap
-
Calling all calorie counters.I've used the calorieking sites (and desktop software) to calorie count. Started off being completely anal about weighing everything etc but the most important thing I've found is portion sizes. You can have all the foods you want - but less of them (or sometimes more of them if you particularly crave vegies :)) After a while you get the idea of how big a portion of chicken/rice/biscuits is and can slack off a bit - but I generally go back to checking portion sizes as soon as I plateau. It worked on its own for a while (just calorie counting the food) with limited exercise a few times a week but as I edge closer to "goal weight" adding in more exercise is helping more - because there are limits to how few calories you can eat and still function. With the help of a heart rate monitor that counts calories burnt (based on age, weight, heart rate etc etc) - which is a better indication than the usual calorie software estimates of 4 cal per km running at XXkm/hr I've done WW before and whilst I lost the weight I kind of abused the system by eating like a rabbit for 2 meals then blowing out at dinner - all the while keeping within my points. I use a small notepad (the paper and pen kind) these days just to record what I've eaten so if it all goes horribly wrong at least I don't have to rely on my memory as to what I ate when. Every now and then I'll put it into calorieking to see how I'm going. A last note - one big thing I use calorieking for is to get the calorie count of recipes I'm making - put all the ingredients in and then divide by the servings. Am starting uni in a couple of weeks to change career to nutrition/dietetics ... it'll take a few years but hopefully will give me a change of pace after 15 years developing (although it'll be over 20 years IT once I actually graduate as a dietitian!!) Whilst I like the technical challenge of IT ... the BS that comes with it is more than I can take anymore ... well, I can take it while I study part time so that the bills get paid ...
-
SQL Server 2000 connectivity issue [fixed]I have a SQL Server 2000 server that I have been accessing happily via SQL Server Management Studio (the 2005 version 9.00.3042.00) for ~16 months. Last week I started getting this error message: "Cannot connect to <>. Additional information: A connection was successfully established with the server, but then an error occured during the login process. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.) (Microsoft SQL Server, Error: 10054)" Some important notes: - I'm a SQL Server admin on the box .. and my rights still exist - SSMS = SQL Server Management Studio Here is what I've tried: - accessing from my PC using Windows Authentication = error message thrown - accessing from another box (remote desktop'd onto another server) using SSMS using Windows Authentication = error message thrown - accessing SQL Server 2005 databases (on a different server) from my PC using Windows Authentication = successful connection - accessing from my PC using SQL Server Authentication = successful connection - remote desktop onto the server in question, then open Enterprise Manager and access a database = successful connection - accessing from another PC as someone else via WIndows Authentication = successful connection As far as I know the only thing to change on my PC is that I installed a MS patch (KB972270). This patch is also on the other PC that works for other people so I'm guessing that it isn't the problem ... Any ideas would be gratefully accepted ... Thanks! [edit] Seems some tinkering in the corporate firewall was the culprit - all fixed now.