Welcome,
Guest
. Please
login
or
register
.
November 12, 2024, 09:13:47 PM
News:
tastyspleen.net has a new discord server:
http://discord.tastyspleen.net
Home
Forum
Help
TinyPortal
Search
Calendar
Login
Register
tastyspleen::quake 2 community
»
Forum
»
The Tech Junkie Boards
»
0x1337c0de
»
Nifty answer for C# UNC path checking
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Nifty answer for C# UNC path checking (Read 4232 times)
peewee_RotA
Brobdingnagian Member
Posts: 4152
Hi, I'm from the gov'ment and I'm here to help you
Rated:
Nifty answer for C# UNC path checking
«
on:
December 08, 2010, 06:32:49 AM »
[DllImport("shlwapi.dll", CharSet = CharSet.Unicode)]
[ResourceExposure(ResourceScope.None)]
[return: MarshalAsAttribute(UnmanagedType.Bool)]
internal static extern bool PathIsUNC([MarshalAsAttribute(UnmanagedType.LPWStr), In] string pszPath);
http://stackoverflow.com/questions/520753/what-is-the-correct-way-to-check-if-a-path-is-an-unc-path-or-a-local-path
I have to say that the ability to Marshal unmanaged code bits into C# fixes all of my reservations of the fact that it's a managed language.
Logged
GOTO ROTAMODS (rocketgib)
GOTO ROTAMAPS (fireworks)
HappyFriar- q2server.fuzzylogicinc.com
Tune in to the
Tastycast!!!!
http://dna.zeliepa.net
quadz
Loquaciously Multiloquent Member
Posts: 5352
Rated:
Re: Nifty answer for C# UNC path checking
«
Reply #1 on:
December 08, 2010, 07:21:07 AM »
As an aside, here's the Ruby equivalent:
PathIsUNC = Win32API.new('shlwapi', 'PathIsUNC', 'P', 'I')
Logged
"He knew all the tricks, dramatic irony, metaphor, bathos, puns, parody, litotes and... satire. He was vicious."
Print
Pages: [
1
]
Go Up
« previous
next »
tastyspleen::quake 2 community
»
Forum
»
The Tech Junkie Boards
»
0x1337c0de
»
Nifty answer for C# UNC path checking
El Box de Shoutamente
Last 10 Shouts:
Costigan_Q2
November 11, 2024, 06:41:06 AM
"Stay cozy folks.
Everything is gonna be fine."
There'll be no excuses for having TDS after January 20th, there'll be no excuses AT ALL!!!
|iR|Focalor
November 06, 2024, 03:28:50 AM
RailWolf
November 05, 2024, 03:13:44 PM
Nice
Tom Servo
November 04, 2024, 05:05:24 PM
The Joe Rogan Experience episode 223 that dropped a couple hours ago with Musk, they're talking about Quake lol.
Costigan_Q2
November 04, 2024, 03:37:55 PM
Stay cozy folks.
Everything is gonna be fine.
|iR|Focalor
October 31, 2024, 08:56:37 PM
Costigan_Q2
October 17, 2024, 06:31:53 PM
Not activated your account yet?
Activate it now! join in the fun!
Tom Servo
October 11, 2024, 03:35:36 PM
HAHAHAHAHAHA
|iR|Focalor
October 10, 2024, 12:19:41 PM
I don't worship the devil. Jesus is Lord, friend. He died for your sins. He will forgive you if you just ask.
rikwad
October 09, 2024, 07:57:21 PM
Sorry, I couldn't resist my inner asshole.
Show 50 latest
User
Welcome,
Guest
. Please
login
or
register
.
November 12, 2024, 09:13:47 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search
Advanced search