add http request 
string rawurl = Request.Url.ToString();
string nohttp = rawurl.Substring(rawurl.IndexOf("://") + 3);
string hostName = nohttp.Substring(0, nohttp.IndexOf("/"));

string hostURL = rawurl.Substring(0, rawurl.IndexOf(hostName) + hostName.Length);
string fullUrl = hostURL + url;


/*
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(fullUrl);
request.KeepAlive = false;
request.Method = "GET";
request.ContentType = "text/html";
request.AllowAutoRedirect = true;

HttpCookie cookie = Request.Cookies[FormsAuthentication.FormsCookieName];

CookieContainer cookies = new CookieContainer();

cookies.Add(new Uri(hostURL), new Cookie("ASP.NET_SessionId", Session.SessionID));
cookies.Add(new Uri(hostURL), new Cookie(cookie.Name, cookie.Value));
request.CookieContainer = cookies;

HttpWebResponse response = (HttpWebResponse)request.GetResponse();
*/

[ add comment ]   |  permalink  |  related link  |   ( 3 / 1073 )
Auto Start VM in Virtual Box When Linux Start 
1. Creat File /etc/default/virtualbox
# vi /etc/default/virtualbox
# virtualbox defaults file
VBOXAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=/etc/vbox/default.cfg

2.
Now we need to create /etc/vbox/default.cfg file and add

# Default policy is to deny starting a VM, the other option is "allow".
default_policy = deny
# Create an entry for each user allowed to run autostart
myuserid = {
allow = true
}

If you are the only user you can just add the line default_policy = allow to the default.cfg file.

3. set permission
Set permissions on directory to the vboxuser group and make sure users can write to the directory as well as sticky bit.
# chgrp vboxusers /etc/vbox
# chmod 1775 /etc/vbox

Add each of the users to the vboxusers group. Make sure to check their group memberships so they do not loose any groups they currently have assigned to their id.

# groups myuserid
myuserid

# usermod -G vboxusers myuserid

Every user who wants to enable autostart for individual machines has to set the path to the autostart database directory with

4. Log in as user myuserid
$ VBoxManage setproperty autostartdbpath /etc/vbox

Now we are ready to set the VM's we choose to start.

$ VBoxManage modifyvm --autostart-enabled on

This will create a myuserid.start file in /etc/vbox directory

5. Su to root restart vboxautostart-service
Now restart the vboxautostart-service to read in the changes.
# service vboxautostart-service restart

[ add comment ]   |  permalink  |  related link  |   ( 3 / 4477 )
Event ID 36 IIS Error 
When u Facing
Event ID 36
The server failed to load application '/LM/W3SVC'. The error was 'The specified metadata was not found.

1. Delete IIS related package in Component Services MMC
- IIS In-Process Applications.
- IIS Out-of-Process Pooled Applications.
- IIS Utilities.
If you get ''Item cannot be deleted'' go into the Properties, Advanced, and clear the ''Disable deletion'' tickbox.
2. Open command prompt, navigate to %windir%\system32\inetsrv folder, and enter (case sensitive):
c:\winnt\system32\inetsrv\>rundll32 wamreg.dll, CreateIISPackage
then
c:\winnt\system32\inetsrv\>regsvr32 asptxn.dll

3. Enter IISRESET at the command prompt to restart IIS services, and then re-open Component Services MMC to verify that the IIS packages are recreated.



[ add comment ]   |  permalink  |  related link  |   ( 3 / 4466 )
Add Chinese in Sony In Book - Epub file 
1.Open by calibre - E-book management
2. Right Click Tweak
3. Explode
4. Modify CSS file add following

@font-face {
font-family:"cnepub";
src:url(res:///ebook/fonts/DroidSansFallback.ttf);
}

5. Add the following line in each cs style
font-family:"cnepub";

6. Save

Example

@font-face {
font-family:"cnepub";
src:url(res:///ebook/fonts/DroidSansFallback.ttf);
}
.calibre {
display: block;
font-size: 1em;
font-family:"cnepub";
margin-bottom: 0;
margin-left: 5pt;
margin-right: 5pt;
margin-top: 0;
padding-left: 0;
padding-right: 0
}

[ add comment ]   |  permalink  |  related link  |   ( 3 / 4190 )
PPS 越权法 
这个叫做PPS 越权法,是能让大家在PPS观看被隐藏的节目和最新的港台剧场节目。 我最喜欢的香港TVB剧场电视剧原本被隐藏的,用了这个方法就可以看了 ^^

【Windows XP】 :

(第一步骤):
首先, 先在C:Windows 找这两个FILE NAME (ppsarea 或者是 psnetwork)

(第二步骤):
找到之后就打开并更改里面的内容,然后点击 save。

1.)打开 ppsarea,复制以下的内容上去,覆盖旧的内容,然后按 save。

[areainfo]
servertime=1318520564
localtime=1318520576
country=4S4K3ZM3XU
area=4WGY5ZFYTQ
province=42YZ72ELR4
city=4WGZPZF2VQ
net=42KZT2ECWLT33EI
ip=352611


(第三步骤):

save了过后, 在这两个file right click > Properties 请打勾Read-only > Apply > OK

最后重新打开PPS PLAYER, 在这时最新的香港节目就在您眼前!

-----------------------------------------------------------------

【Windows 7】:

(第一步骤):
首先找这两个FILE NAME (ppsarea or psnetwork)

寻找方法 1 :在RUN那里打开然后输入 %APPDATA% 然后按 Enter


寻找方法 2 :
在C:Users用户名AppDataRoamingPPStream找这两个FILE NAME (ppsarea or psnetwork)

接下来的第二步骤 & 第三步骤跟着 Windows XP 以上方法去做就可以了。

----------------------------------------------------------------

【Windows vista】 :

(第一步骤):
先在C:Windows 找这两个FILE NAME (psnetwork)

寻找方法 1 :在RUN那里打开然后输入 %APPDATA% 然后按 Enter

寻找方法 2 :
在C:Users用户名AppData> oaming> PPStream 找这FILE NAME ( psnetwork)

(第二步骤):

找到之后就打开并更改里面的内容,然后点击 save。

1.)打开 [psnetwork] ,复制以下的内容上去,覆盖旧的内容,然后按 save。

[areainfo]
ret_code=200
last_tick=1051906
country=4S4K3ZM3XU
area=4WGY5ZFYTQ
province=42YZ72ELR4
city=4WGZPZF2VQ
net=42KZT2ECWLT33EI
ip=692071634
ut=1318520576

(第三步骤):

因为vista 找没有 ppsarea,就自己新建记事本,复制以下内容,然后保存为「psnetwork」。

[areainfo]
servertime=1318520564
localtime=1318520576
country=4S4K3ZM3XU
area=4WGY5ZFYTQ
province=42YZ72ELR4
city=4WGZPZF2VQ
net=42KZT2ECWLT33EI
ip=352611

(第四步骤):
save了过后, 在这两个file right click > Properties 请打勾Read-only > Apply > OK

最后重新打开PPS PLAYER, 在这时最新的香港节目就在您眼前!


[ 194 comments ] ( 2172 views )   |  permalink  |  related link  |   ( 3 / 10916 )

BackBack NextNext