|
jan larsen wrote:
For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
That's great - I laughed out loud - I think people are staring...
|
|
|
|
|
|
The even cooler thing is that, from what I understand, they plan on giving out the source to the entire site
|
|
|
|
|
Ray Cassick wrote:
The even cooler thing is that, from what I understand, they plan on giving out the source to the entire site
Seeing they have the right too all software hosted there, I would expect something in return.
|
|
|
|
|
leppie wrote:
I would expect something in return.
Attidues like this annoy me.
Microsoft is giving out free hosting for your projects, providing free tools and even planning on releasing all the source code for this app. Hosting costs serious money and not too mention the email subscriptions to the message boards on Workspaces.
If you don't like their license agreement then don't use it, simple as that. You cannot expect MS to give you a free lunch with Workspaces.
Hell, why don't you setup everything and start your own Workspaces.leppie or something. Maybe then you will see just what it takes to provide a "free" service.
|
|
|
|
|
Paul Watson wrote:
Microsoft is giving out free hosting for your projects, providing free tools and even planning on releasing all the source code for this app. Hosting costs serious money and not too mention the email subscriptions to the message boards on Workspaces.
Nothin stops me to goto SourgeForge or any other existing project solution that actually allow me to keep the right to my own work.
Paul Watson wrote:
If you don't like their license agreement then don't use it, simple as that. You cannot expect MS to give you a free lunch with Workspaces.
I never said I want it, I said I would expect something in return for MY work if they planning on using it. Even if its only recognition.
Paul Watson wrote:
Hell, why don't you setup everything and start your own Workspaces.leppie or something. Maybe then you will see just what it takes to provide a "free" service.
If I had the resources of MS, I would. Plus many more things!
Paul Watson wrote:
Attidues like this annoy me.
I wont comment, thats something every person has to decide for himself.
|
|
|
|
|
I'm not sure if this is the best place to post this or not... Anyway, I'm actually writing my program in VB.NET (no flames please) but the semantics are the same in this case...
This is probably a dumb question (ducks) but I just wrote my first application to actually use a .NET Web Service to retrieve content. It was really very easy to do and I like it alot... but .NET is actually going a step further than I really need it to. In my case, I actually WANT the raw XML response that's coming back from the web service. However, .NET is appropriately using the WDSL to package the response into a member of variable of the specified return type... which is really nice... if I needed that. Can anyone help me get at the XML response itself?
|
|
|
|
|
Sorry I cant help you
But you would get a quicker response in the Web Development forum
|
|
|
|
|
Matt Philmon wrote:
In my case, I actually WANT the raw XML response that's coming back from the web service. However, .NET is appropriately using the WDSL to package the response into a member of variable of the specified return type... which is really nice... if I needed that. Can anyone help me get at the XML response itself?
This is actually easier than you think, but it also baffled me for awhile.
Basically it is very easy: You use the the XMLTextReader and pass it the full URL of the web service. Not as a SOAP packet or anything, just the URL. You naturally need to pass the parametres through in the URL.
e.g. In my CP+ article I do exactly what you want like so: xtrBriefs = new XmlTextReader ("http://www.codeproject.com/webservices/latest.asmx/GetLatestArticleBrief?NumArticles=2");
It is C# but you can easily do it in VB.NET too. Have a look at my article, it explains how to retrieve the XML data and how to save it.
|
|
|
|
|
Thanks ALOT! That's perfect and exactly what I need. Sniff, sniff.. getting emotional. Heh.
|
|
|
|
|
ok, now before i go mad, can someone help me out here. below is what i have to change privileges.
public static bool SetPrivilege(string privilege, bool enabled)
{
if (Environment.OSVersion.Version.Major >= 4)
{
IntPtr tknPtr = IntPtr.Zero;
Process pr = Process.GetCurrentProcess();
OpenProcessToken(pr.Handle, 0, out tknPtr);
TOKEN_PRIVILEGES tp = new TOKEN_PRIVILEGES();
LUID luid = new LUID();
StringBuilder privString = new StringBuilder(privilege);
if (!LookupPrivilegeValue(null, privString, out luid ))
return false;
tp.PrivilegeCount = 1;
tp.Privileges[0].Luid = luid;
tp.Privileges[0].Attributes = enabled ? 0x00000002L : 0;
int sz = Marshal.SizeOf(typeof(long))*2;
sz += Marshal.SizeOf(typeof(int))*2;
return AdjustTokenPrivileges(tknPtr, false, tp, sz, null, 0);
}
else
return false;
}
[StructLayout(LayoutKind.Auto)]
private class TOKEN_PRIVILEGES
{
public int PrivilegeCount;
public LUID_AND_ATTRIBUTES[] Privileges = new LUID_AND_ATTRIBUTES[1];
}
[StructLayout(LayoutKind.Sequential)]
private struct LUID_AND_ATTRIBUTES
{
public LUID Luid;
public long Attributes;
}
[StructLayout(LayoutKind.Sequential)]
private struct LUID
{
public int LowPart;
public long HighPart;
}
and the marshaller complains about param #5:
AdjustTokenPrivileges(tknPtr, false, tp, sz,null, 0);
saying about how it cannot be marshalled no because it has no layout information. btw i get the same error even when i dont use null, and use a TOKEN_PRIVILEGE instead.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
Nnamdi Onyeyiri wrote:
[StructLayout(LayoutKind.Auto)]private class TOKEN_PRIVILEGES { public int PrivilegeCount; public LUID_AND_ATTRIBUTES[] Privileges = new LUID_AND_ATTRIBUTES[1];}
That MUST be Sequential as well.
BOOL AdjustTokenPrivileges(
HANDLE TokenHandle, // handle to token
BOOL DisableAllPrivileges, // disabling option
PTOKEN_PRIVILEGES NewState, // privilege information
DWORD BufferLength, // size of buffer
PTOKEN_PRIVILEGES PreviousState, // original state buffer
PDWORD ReturnLength // required buffer size
);
Param #5:
PreviousState
[out] Pointer to a buffer that the function fills with a TOKEN_PRIVILEGES structure that contains the previous state of any privileges that the function modifies. This parameter can be NULL.
If you specify a buffer that is too small to receive the complete list of modified privileges, the function fails and does not adjust any privileges. In this case, the function sets the variable pointed to by the ReturnLength parameter to the number of bytes required to hold the complete list of modified privileges.
That is the keyword. Normally these ype of functions need to be called twice. First to find the size of the buffer that is to be allocated (Marshalled in your case) and then to perform the actual function.
I came across these types too in the RASAPI, and I assume they are everywhere
See ms-help://MS.VSCC/MS.MSDNVS/rras/rasclnt_88j7.htm[^] for more info. Have a look at the C++ example and things will become clear.
UPDATE: oi that link dont work, funny links from Visual Studio help works... Just copy shortcut then.
Hope this helps
|
|
|
|
|
|
Try this ,
[StructLayout(LayoutKind.Sequential)]
class TOKEN_PRIVILEGES
{
int privilegeCount;
public LUID_AND_ATTRIBUTES[] Privileges;
public TOKEN_PRIVILEGES(int size)
{
this.privilegeCount = size;
this.Privileges = new LUID_AND_ATTRIBUTES[size];
}
}
or send me what you have...
|
|
|
|
|
Also LUID is a 64-bit value, so no need to create a LUID (which is wrong btw ) just use a long value.
|
|
|
|
|
i am having difficulty implementing this function c# i have implemented it in vb.net i am unable to write the values of the enums in c# as this is the way we write the eums in vb.net
Private Enum FileFlags
FOF_ALLOWUNDO = &H40S
FOF_CONFIRMMOUSE = &H2S
FOF_FILESONLY = &H80S
FOF_MULTIDESTFILES = &H1S
FOF_NOCONFIRMATION = &H10S
FOF_NOCONFIRMMKDIR = &H200S
FOF_RENAMEONCOLLISION = &H8S
FOF_SILENT = &H4S
FOF_SIMPLEPROGRESS = &H100S
FOF_WANTMAPPINGHANDLE = &H20S
End Enum
Private Enum FileFunctions
FO_COPY = &H2S
FO_DELETE = &H3S
FO_MOVE = &H1S
FO_RENAME = &H4S
End Enum
can anyone tell me the alternative of this in c#
thank you!
|
|
|
|
|
Instead of using &H1000S use 0x1000
HTH,
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
public enum SHFOOperation : int
{
Move = 0x1,
Copy = 0x2,
Delete = 0x3,
Rename = 0x4,
}
[Flags]
public enum SHFOFlags : int
{
None = 0x000,
MultiDestFiles = 0x001,
ConfirmMouse = 0x002,
Silent = 0x004,
RenameOnCollision = 0x008,
NoConfirmation = 0x010,
WantMappingHandle = 0x020,
AllowUndo = 0x040,
FilesOnly = 0x080,
SimpleProgress = 0x100,
NoConfirmMkDir = 0x200,
NoErrorUi = 0x400,
NoCopySecurity = 0x800,
}
|
|
|
|
|
I want to know how UploadFile can work?
I use it like this
myWebClient.UploadFile("http://localhost/myuploaddir/uploadfile.txt","c:\\myfile.txt");
but it always throw error 405 Method Not Allowed.
I set the directory to write allowed.but it does not work.
Many people encountered the same thing.
What is the problem?
lost my way
|
|
|
|
|
Hi,
Is there any way for differentiating whether a Forms Constructor is
called at DesignTime (by the FormsDesigner) or at Runtime.
I have some code in a Forms Constructor that should be executed only when the
Application is Run, and not when the Form is opened by the Forms Designer.
Thanks,
Firoz
|
|
|
|
|
If possible, you can add another constructor and those values there. The desingner will ( ) allways use the default constuctor, else you can check the DesignTime property, but that can be a bit over the top for something small.
Hope this helps
|
|
|
|
|
Hi leppie,
Thanks,
leppie wrote:
add another constructor
That is a great Idea. It works.
But, (in my project) this will require code modification in a lot of places.
Actually, I have a base form and around 40 forms derived from this base form.
It would be wonderful, if I could put some code in the Base Form constructor
itself, instead of modifying the constructor of all derived forms.
But I liked your Idea, and I will keep it as a last option.
leppie wrote:
check the DesignTime property
I had tried this before, but this property always returns false.
Can you put some more light into this (how to use the DesignTime property).
Thanks,
Firoz
|
|
|
|
|
so this does not work?
public MyClass()
{
if (DesignMode)
{
}
else
{
}
}
Note you can never check for this yourself...
Hope this helps
|
|
|
|
|
leppie wrote:
so this does not work?
Nope, that doesn't work... Why? Think about it this way; the DesignMode mode property uses the ISite property to do its work. But at that point of your code no properties have been set so ISite is still null which is why DesignMode will always return false.
Shortly after code execution has left the constructor for your object, then ISite will be set and DesignMode will return its proper value.
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
Thanx James
So the only way to go is an overloaded constructor?
|
|
|
|