
mark007
Avatar/Signature-
Posts
185 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by mark007
-
No problem. :)
-
Appears to be only the last letters though so seems more of a bug than anything else to me.... :confused:
-
You've not really fully answered my question. Also I assume you mean use a web.config file: <authorization> <deny users="*" /> </authorization> Although this will deny people accessing my aspx pages I'm not convinced this will stop them viewing pdf files that have nothing to do with asp.net. Thank so far though. :)
-
Ok, what HTML and CodeBehind are you using with the checkbox?
-
Where are you actually wanting to add the column? I think you need to specify it i.e.: oSheet.Columns(2).Insert(Excel.XlInsertShiftDirection.xlShiftToRight,False) To insert a column in at col B etc. You could also use: oSheet.Range("b2").EntireColumn.Insert(Excel.XlInsertShiftDirection.xlShiftToRight,False) etc. HTH :)
-
Could you elaborate? Is your error an asp.net error or a client side javascript error?
-
What html are you using to declare the textbox and what code are you using to declare the checkbox in the code behind?
-
The code given by marble_eater will return an array of the files that match "test*.txt". What you do with any one of them then is up to you. As long as your application doesn't need to worry about not being seen to do anything for 5 minutes you could use: System.Threading.Thread.Sleep(300000) to wait 5 minutes. Alternatively you could obtain the current time and loop until the time is 5 minutes later calling: System.Windows.Forms.Application.DoEvents To receive any events in the mean time. :)
-
Sure you could also use: lngRow=wsh.UsedRange.Rows.count It is slightly less reliable in that it doesn't reset as often as it should but most of the time would suffuce fine. :)
-
I want to have a folder containing files - pdf's for argument's sake - that are only accessible to logged in users. So if someone typed: http://www.someurl.com/pdfs/mypdf.pdf They would get an access denied message. I could do this on Apache just using a .htaccess file in the folder. What's the IIS equivalent? Secondly I then need to display the file for logged in users using something like: http://www.someurl.com/showpdf.aspx?mypdf.pdf Again using PHP on Apache although the folder is secure to external users local files can access the folder and I simply use Readfile('filename'); to output the file to the browser (as well as some headers to tell the browser the content-type). How would I do this is ASP.Net. I'm thinking along the lines of reading the file into a stream and then outputting it to the Response.OutputStream somehow. Thanks.
-
Personally I have a standard class as this way I can use it in all applications. Further than this I create a interface IData that contains the methods I will need - such as connect, close, return disconnected data, return connected data, execute a query etc. All my db classes then implemenet this meaning I can change the database used in an application by changing one line from: Dim d as IData=New AccessData to: Dim d as IData=New MSSQLData etc. Also allows me to have applications where the data provider can be chosen by the client. :)
-
To get the last row with something in it in column A you can use: lngRow=wsh.Range("a65536").End(xlUp).Row Though the c# code could well be very different as it doesn't interface with the Excel object model too well so has it's own PIA's. :)
-
I need to generate some images on the fly in my ASP.net pages. Currently the only way I think I can do this is to have a page dedicated to generating image with the content type image/jpeg and then saving the image to the outputstream of the response. The in my main page pass this page as the src of an Img tag. I have 2 queries: 1. Is this the only/best way of displaying a dynamic image on a page? 2. What's the best way of getting data from the page to the image? If it was a small amount of data I could just put it in the querystring of the src url of the img tag but it's likely to be an array of variable length. I was therfore thinking of using the cache to save the data to perhaps under an id. The image generating page could then have the ID passed in the querystring and retrieve the data from the cache and finally remove it to free it up. Is this the best way of doing it? Can anybody think of any flaws? Thanks. :)
-
I would say it's the compilation. When the website is first requested the files are compiled. With further requests .Net checks for a newer version of the file - if one doesn't exist it uses it's already compiled version. :)
-
I don't think any solution would avoid the flash as that would happen on any update. What I meant by temporary was that I'm not sure this sets the registry setting for you so you might have to do that in addition for a permanent colour change i.e. on reboot. In any case glad I finally found the API that did it! :)
-
Interesting comments. I do like .Net but think PHP and .Net do both have their place. I work with both. Alot of people still and will continue to use linux web servers and while this is the case knowing both is the only option. :)
-
Well the db and web server are on the same server in this case. For files I would have to give people FTP access or I guess I could create some code to deal with file management for the files I wished to let people change. The idea really though is to separate functionality from style completely and although with code behind files this is mostly acheived I wouldn't want to let someone with no ASP.Net experience loose on a .aspx page. I think some of the 2.0 features could be interesting though I don't have time to play with the beta at the moment. I can of course create the effect I am after to some extent by using my own parsing - perhaps making all variables enclosed in [] etc. I have done something similar for a templated menu control I created. Seemed the only way to template it as much as I wanted to. :)
-
The idea is that the whole site design can be changed from anywhere by simply logging into the site and changing the templates. This is how this forum works for example. :)
-
OK, the following might do it. I think this will give a temporary instant fix which you can combine with the long term registry fix: Private Declare Function SetSysColors Lib "user32" Alias "SetSysColors" (ByVal nChanges As int32, lpSysColor As Int32, lpColorValues As Int32) As Int32 Private Const COLOR_BACKGROUND as Int32 = 1 'Colour of the background with no wallpaper 'not sure of .Net equivalent of RGB function so that will need changing SetSysColors(1, COLOR_BACKGROUND, RGB(255, 0, 0)) :)
-
Could try with: SPI_SETDESKPATTERN instead of: SPI_SETNONCLIENTMETRICS Though I suspect this may ahve the same effect as post #7 above. Will keep looking.. :)
-
Well the difference here is that this template I am talking about is to be stored in a database rather than an aspx file. Even if it weren't there may be other scenarios where a similar template within template may occur. That is where the problem lies. Been finding it hard to put across exactly what I mean I guess. Hmm, Consider a page where I have a literal control. The Contents of this literal control are filled from a database. All is ok so far. No suppose however that this information that comes from the database contains varaibles. For arguments sake I'll use title again. A very simple template for a title might be <b>Title Here</b>. Now if I also load from the db the value of the title into a string variable How would I: a) Create the template that would contain the variable remembereing that this needs to be stored as text in the database, and b)Evaluate the template so that the variable is replaced by the actual title ? Also on a templating sort of note - the exmaples I've seen of inheriting from a custom base class that inherits Page on each page in the site although very useful for adding standard functions to the page doesn't seem that useful from a page layout point of view as you are back to making html out of strings and having to escape all the quotes...just a thought anyway.. :)
-
Hmm, ok try this one: Private Declare Function SendMessageTimeout Lib "user32" Alias "SendMessageTimeoutA" (ByVal hwnd As Int32, ByVal msg As Int32, ByVal wParam As Int32, ByVal lParam As String, ByVal fuFlags As Int32, ByVal uTimeout As Int32, lpdwResult As Int32) As Int32 Private Const HWND_BROADCAST As Long = &HFFFF& Private Const WM_SETTINGCHANGE = &H1A& Private Const SMTO_ABORTIFHUNG = &H2& Dim Result as Int32 SendMessageTimeout HWND_BROADCAST, WM_SETTINGCHANGE, _ SPI_SETNONCLIENTMETRICS, 0&, SMTO_ABORTIFHUNG, _ 10000&, Result :)
-
You could try the following: private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Int32, ByVal uParam As Int32, ByVal lpvParam As Int32, ByVal fuWinIni As Int32) As Int32 Private Const SPI_SETDESKPATTERN as Int32 = 21 Private Const SPIF_UPDATEINIFILE as Int32 = &H1 SystemParametersInfo SPI_SETDESKPATTERN, 0&, 0&, SPIF_UPDATEINIFILE :)
-
Something like the following, though I'm a VB rather than C# guy: ArrayList fnames = new ArrayList(); Worksheet wsh = (Worksheet)wb.Sheets[1]; Range cell = null; Range r=wsh.Range(wsh.Range("a1"),wsh.Range("a5162")) for each cell in r { try { fnames.Add((string)cell.Value2); } catch {} } :)
-
For example just now I used Winspector Spy to find the class name of AVG antivirus which is in my systray. I then watched the messages for the message sent on Double-Click which was WM_USER+23. I then knocked up a windows app with a button on the form called Show AVG. The code behind the form is then: Public Class Form1 Inherits System.Windows.Forms.Form Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As Int32) As Int32 Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Int32, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32 'Windows Form Designer Generated Code Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'find avg handle Dim hWnd As Int32 Const WM_USER As Int32 = &H400 Const msg As Int32 = WM_USER + 23 hwnd = FindWindow("AVG70ControlCenter", 0&) 'show it SendMessage(hWnd, msg, 0&, 0&) End Sub End Class Hope that helps. :)